Every repository with this icon (
Every repository with this icon (
API documentation
Type class
Type.function(type, arg1, arg2, ...)
Returns a FunctionType to use when retrieving a function.
Arguments arg1, … are of LLVM::Type.
Corresponds to FunctionType::get(type, vector, false).
Module class
get_or_insert_function(name, function_type)
Returns Function with the given name and signature, creating the function if it does not exist.
See getOrInsertFunction(const std::string &Name, const FunctionType *T)
Function class
arguments()
Returns a list of Value for each function argument.
Corresponds to using arg_begin() and arg_size().
create_block()
Returns a new BasicBlock for this function.
Corresponds to BasicBlock::Create("", function)
BasicBlock class
builder()
Returns a new Builder for this block.
Corresponds to using Builder.SetInsertPoint(basic_block)
Builder class
call(function, arg1, arg2, ...)
Appends a function call to the block, with the given arguments.
Arguments given are arguments to the call and should be of class LLVM::Value.
Corresponds to using Builder.CreateCall(function, args.begin(), args.end(), "").
return(value)
Appends a function return to the block with the given LLVM::Value.
Corresponds to Builder.CreateRet(value).
add(value, value)
Appends the add function to the block, adding the two values given.
Corresponds to Builder.CreateAdd(value, value).
sub(value, value)
Appends the sub function to the block, subtracting the second value from the first.
Corresponds to Builder.CreateSub(value, value).
mul(value, value)
Appends the mul function to the block, multiplying the two values.
Corresponds to Builder.CreateMul(value, value).
fcmp_oeq(value, value)
Appends a float compare, returning 1 if neither value is a QNAN and values are equal.
fcmp_ogt(value, value)
Appends a float compare, returning 1 if neither value is a QNAN and first value is greater than the second value.
fcmp_oge(value, value)
Appends a float compare, returning 1 if neither value is a QNAN and first value is less than or equal to the second value.
fcmp_olt(value, value)
Appends a float compare, returning 1 if neither value is a QNAN and first value is less than the second value.
fcmp_ole(value, value)
Appends a float compare, returning 1 if neither value is a QNAN and first value is less than or equal to the second value.
fcmp_one(value, value)
Appends a float compare, returning 1 if neither value is a QNAN and first value is not equal to the second value.
fcmp_ord(value, value)
Appends a float compare, returning 1 if neither value is a QNAN.
fcmp_ueq(value, value)
Appends a float compare, returning 1 if either value is a QNAN or first value is equal to the second value.
fcmp_ugt(value, value)
Appends a float compare, returning 1 if either value is a QNAN or first value is greater than the second value.
fcmp_uge(value, value)
Appends a float compare, returning 1 if either value is a QNAN or first value is greater than or equal to the second value.
fcmp_ult(value, value)
Appends a float compare, returning 1 if either value is a QNAN or first value is less than the second value.
fcmp_ule(value, value)
Appends a float compare, returning 1 if either value is a QNAN or first value is less than or equal to the second value.
fcmp_uno(value, value)
Appends a float compare, returning 1 if either value is a QNAN.
trunc(value, type)
Appends a 'trunc .. to' instruction, truncating an integer from the current bit size to the size given by type. The type of the value must have a wider bit size than the target, equal sizes are not allowed.
zext(value, type)
Appends a 'zext .. to' instruction, extending an integer from the current bit size to the size given by type. The type of the value must have a smaller bit size than the target, equal sizes are not allowed.
sext(value, type)
Appends a 'sext .. to' instruction, sign extending an integer from the current bit size to the size given by type. The type of the value must have a smaller bit size than the target, equal sizes are not allowed.
See the 'sext .. to' instruction.
fp_trunc(value, type)
Appends a 'fptrunc .. to' instruction, truncating a float value to the bit size given by type. The target bit size must always be smaller than the bit size of the original value.
See the 'fptrunk .. to' instruction.
fp_ext(value, type)
Appends a 'fpext .. to' instruction, extending a float value to the bit size given by type. The target bit size must always be larger than the bit size of the original value.
See the 'fpext .. to' instruction.
fp_to_ui(value, type)
Appends a 'fptoui .. to' instruction, converting a floating point value to its unsigned integer value.
See the 'fptoui .. to' instruction.
fp_to_si(value, type)
Appends a 'fptosi .. to' instruction, converting a floating point value to its signed integer value.
See the 'fptosi .. to' instruction.
ui_to_fp(value, type)
Appends a 'uitofp .. to' instruction, converting an unsigned integer value to a floating point type.
See the 'uitofp .. to' instruction.
si_to_fp(value, type)
Appends a 'sitofp .. to' instruction, converting a signed integer value to a floating point type.
See the 'sitofp .. to' instruction.
ptr_to_int(value, type)
Appends a 'ptrtoint .. to' instruction, converting a pointer to an integer. This will automatically truncate or extend the pointer value as needed.
See the 'ptrtoint .. to' instruction.
int_to_ptr(value, type)
Appends a 'inttoptr .. to' instruction, converting an integer to a pointer. This will automatically truncate or zero-extend the integer value as needed.
See the 'inttoptr .. to' instruction.
bit_cast(value, type)
Appends a 'bitcast .. to' instruction, converting a value to another value of the same bit size.
See the 'bitcast .. to' instruction.







