LLVM
llvm.org › doxygen › classllvm_1_1Function.html
LLVM: llvm::Function Class Reference
This value is always defined to be zero to allow easy checking for whether a function is intrinsic or not. The particular intrinsic functions which correspond to this value are defined in llvm/Intrinsics.h.
LLVM
llvm.org › doxygen › classllvm_1_1FunctionType.html
LLVM: llvm::FunctionType Class Reference
Class to represent function types. Definition at line 105 of file DerivedTypes.h. Definition at line 128 of file DerivedTypes.h. Methods for support type inquiry through isa, cast, and dyn_cast. Definition at line 147 of file DerivedTypes.h. References llvm::Type::FunctionTyID, T, and llvm::Type::Type().
Videos
19:34
LLVM IR C++ API: PHI Nodes, stack memory and printf - YouTube
22:16
2018 LLVM Developers’ Meeting: M. Spencer “Profile Guided ...
10:21
Programming Language with LLVM [3/20] Basic numbers | Main function ...
06:44
Programming Language with LLVM [4/20] Strings | Extern Calls - YouTube
Programming Language with LLVM [1/20] Introduction to ...
26:20
Write Your First LLVM FunctionPass for Instrumentation - YouTube
LLVM
llvm.org › doxygen › group__LLVMCCoreValueFunctionParameters.html
LLVM: Function Parameters
Obtain the next parameter to a function. This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is actually a wrapped iterator) and obtains the next parameter from the underlying iterator.
LLVM
llvm.org › docs › LangRef.html
LLVM Language Reference Manual — LLVM 23.0.0git documentation
May 12, 2026 - LLVM programs are composed of Module’s, each of which is a translation unit of the input programs. Each module consists of functions, global variables, and symbol table entries. Modules may be combined together with the LLVM linker, which merges function (and global variable) definitions, resolves forward declarations, and merges symbol table entries.
LLVM
releases.llvm.org › 2.6 › docs › tutorial › JITTutorial1.html
LLVM Tutorial 1: A First Function
October 24, 2009 - For starters, let's consider a relatively straightforward function that takes three integer parameters and returns an arithmetic combination of them. This is nice and simple, especially since it involves no control flow: int mul_add(int x, int y, int z) { return x * y + z; } As a preview, the LLVM ...
LLVM
llvm.org › doxygen › group__LLVMCCoreTypeFunction.html
LLVM: Function Types
The function is defined as a tuple of a return Type, a list of parameter types, and whether the function is variadic. Definition at line 779 of file Core.cpp. References llvm::FunctionType::get(), llvm::unwrap(), and llvm::wrap().
mcyoung
mcyoung.xyz › 2023 › 08 › 01 › llvm-ir
A Gentle Introduction to LLVM IR · mcyoung
The body of a function resembles assembly: a list of labels and instructions. Unlike ordinary assembly, however, there are significant restrictions on the structure of these instructions. In this case, there is only one instruction: a void-typed return. Unlike most assembly languages, LLVM IR is strongly typed, and requires explicit type annotations almost everywhere.
Readthedocs
mapping-high-level-constructs-to-llvm-ir.readthedocs.io › en › latest › basic-constructs › functions.html
Function Definitions and Declarations — Mapping High Level Constructs to LLVM IR documentation
int function(int a, int b) { return a + b; } double function(double a, double b, double x) { return a*b + x; } For LLVM these two are completely different functions, with different names etc.
Hdoc
docs.hdoc.io › hdoc › llvm-project › rADBA2A8E0906EC47.html
class Function: LLVM/Clang 15.x documentation
This is an important base class in LLVM. It provides the common facilities of all constant values in an LLVM program. A constant is a value that is immutable at runtime. Functions are constants because their address is immutable. Same with global variables. All constants share the capabilities provided in this class.
Vu
few.vu.nl › ~lsc300 › LLVM › doxygen › classllvm_1_1Function.html
LLVM: llvm::Function Class Reference
References llvm::Value::FunctionVal, and llvm::Value::getValueID().
Readthedocs
llvmlite.readthedocs.io › en › latest › user-guide › ir › examples.html
Example—defining a simple function — llvmlite 0.49.0dev0+18.g6302ab2.dirty documentation
April 30, 2026 - module = ir.Module(name=__file__) # and declare a function named "fpadd" inside it func = ir.Function(module, fnty, name="fpadd") # Now implement the function block = func.append_basic_block(name="entry") builder = ir.IRBuilder(block) a, b = func.args result = builder.fadd(a, b, name="res") builder.ret(result) # Print the module IR print(module) The generated LLVM intermediate representation is printed at the end:
Jonathan2251
jonathan2251.github.io › lbd › funccall.html
Function call — Tutorial: Creating an LLVM Backend for the Cpu0 Architecture
On the other hand, functions implicitly used by LLVM, such as memcpy, belong to “texternalsym”. The memcpy function is typically generated when defining a long string. The file ch9_1_2.cpp is an example that triggers a call to memcpy.
LLVM
llvm.org › doxygen › group__LLVMCCoreValueFunction.html
LLVM: Function values
References F, llvm::unwrap(), and llvm::wrap(). ... Obtain the calling function of a function.
LLVM
llvm.org › doxygen › classllvm_1_1MachineFunction.html
LLVM: llvm::MachineFunction Class Reference
/ CreateMachineBasicBlock - Allocate a new MachineBasicBlock. Use this / instead of ‘new MachineBasicBlock’. Sets MachineBasicBlock::BBID if basic-block-sections is enabled for the function. Definition at line 506 of file MachineFunction.cpp. References llvm::List, and MBB.
Top answer 1 of 2
6
You can create a new function with Function::Create. See this snippet from the LLVM tutorial for example:
Function *PrototypeAST::Codegen() {
// Make the function type: double(double,double) etc.
std::vector<Type*> Doubles(Args.size(),
Type::getDoubleTy(getGlobalContext()));
FunctionType *FT = FunctionType::get(Type::getDoubleTy(getGlobalContext()),
Doubles, false);
Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
2 of 2
-2
The function create: http://llvm.org/docs/doxygen/html/classllvm_1_1Function.html#a162a63c89ac118c8ffef75b3a892efa0
How to use the create function in the source code of llvm: http://llvm.org/docs/doxygen/html/CloneFunction_8cpp_source.html#l00162
Gatech
cs6340.cc.gatech.edu › LLVM8Doxygen › group__LLVMCCoreValueFunctionParameters.html
LLVM: Function Parameters
Obtain the next parameter to a function. This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is actually a wrapped iterator) and obtains the next parameter from the underlying iterator.
LLVM
llvm.org › docs › ProgrammersManual.html
LLVM Programmer’s Manual — LLVM 23.0.0git documentation
Unlike both printf and Python, it additionally fails to compile if LLVM does not know how to format the type. These two properties ensure that the function is both safer and simpler to use than traditional formatting methods such as the printf family of functions.
Urho3D
docs.huihoo.com › doxygen › llvm › 20140918 › classllvm_1_1Function.html
llvm::Function Class Reference - Huihoo
References llvm::iplist< NodeTy, Traits >::begin(). Definition at line 300 of file Function.cpp.