Joos1W Compiler Framework
|
Public Member Functions | |
IRBuilder (Context &ctx) | |
void | setInsertPoint (BasicBlock::iterator it) |
Set the insertion point to the given basic block. This will insert new instructions after the given instruction iterator. More... | |
void | setInsertPoint (Instruction *instr) |
Set the insertion point to the given instruction. This will insert new instructions after the given instruction. More... | |
void | setInsertPoint (BasicBlock *bb) |
Set the insertion point to the beginning of the given basic block. More... | |
BasicBlock * | currentBlock () |
BasicBlock * | createBasicBlock (Function *parent) |
Create a new basic block within the given function. This does not change the insertion point, unlike the other create functions. More... | |
Instruction * | createBinaryInstr (Instruction::BinOp op, Value *lhs, Value *rhs) |
Create a binary instruction with the given operation and left-hand and right-hand operands (as values). More... | |
Instruction * | createCallInstr (Value *callee, utils::range_ref< Value * > args) |
Create a call instruction with the given callee and arguments. More... | |
Instruction * | createLoadInstr (Type *type, Value *ptr) |
Create a load instruction with the given type and pointer. The type is the type of the value to load and will dictate the size of the load operation. The ptr is the pointer to load from. More... | |
Instruction * | createStoreInstr (Value *val, Value *ptr) |
Create a store instruction with the given value and pointer. The value is the value to store and the ptr is the pointer to store to. More... | |
Instruction * | createReturnInstr (Value *val) |
Create a return instruction with the given value. More... | |
Instruction * | createReturnInstr () |
Create a return instruction with no value (void). More... | |
Instruction * | createBranchInstr (BasicBlock *target) |
Creates an unconditional branch instruction to the given target basic block. More... | |
Instruction * | createBranchInstr (Value *cond, BasicBlock *true_target, BasicBlock *false_target) |
Create a conditional branch instruction with the given condition and true and false target basic blocks. More... | |
Instruction * | createCmpInstr (CmpInst::Predicate pred, Value *lhs, Value *rhs) |
Create a comparison instruction with the given predicate and left-hand and right-hand operands. More... | |
Instruction * | createICastInstr (ICastInst::CastOp op, Value *val, Type *destTy) |
Create the generic trunc/zext/sext instruction with the given operation, value, and destination type. More... | |
Instruction * | createGEPInstr (Value *ptr, StructType *t, utils::range_ref< Value * > indices) |
Definition at line 10 of file IRBuilder.h.
|
inline |
Create a new basic block within the given function. This does not change the insertion point, unlike the other create functions.
parent | The parent function of the basic block |
Definition at line 51 of file IRBuilder.h.
|
inline |
Create a binary instruction with the given operation and left-hand and right-hand operands (as values).
op | The binary operation to perform |
lhs | The LHS value |
rhs | The RHS value |
Definition at line 64 of file IRBuilder.h.
|
inline |
Creates an unconditional branch instruction to the given target basic block.
target | The target basic block |
Definition at line 130 of file IRBuilder.h.
|
inline |
Create a conditional branch instruction with the given condition and true and false target basic blocks.
cond | The condition to branch on |
true_target | The target basic block if the condition is true |
false_target | The target basic block if the condition is false |
Definition at line 143 of file IRBuilder.h.
|
inline |
Create a call instruction with the given callee and arguments.
callee | The function to call |
args | The arguments to pass to the function |
Definition at line 75 of file IRBuilder.h.
|
inline |
Create a comparison instruction with the given predicate and left-hand and right-hand operands.
pred | The comparison predicate |
lhs | The LHS value |
rhs | The RHS value |
Definition at line 157 of file IRBuilder.h.
|
inline |
Create the generic trunc/zext/sext instruction with the given operation, value, and destination type.
op | The cast operation to perform |
val | The value to cast |
destTy | The destination type |
Definition at line 170 of file IRBuilder.h.
|
inline |
Create a load instruction with the given type and pointer. The type is the type of the value to load and will dictate the size of the load operation. The ptr is the pointer to load from.
type | The type of the value to load |
ptr | The pointer to load from |
Definition at line 88 of file IRBuilder.h.
|
inline |
Create a return instruction with no value (void).
Definition at line 119 of file IRBuilder.h.
|
inline |
Create a return instruction with the given value.
val | The value to return |
Definition at line 110 of file IRBuilder.h.
|
inline |
Create a store instruction with the given value and pointer. The value is the value to store and the ptr is the pointer to store to.
val | The value to store |
ptr | The pointer to store to |
Definition at line 100 of file IRBuilder.h.
|
inline |
Set the insertion point to the beginning of the given basic block.
bb | The basic block to set the insertion point to |
Definition at line 35 of file IRBuilder.h.
|
inline |
Set the insertion point to the given basic block. This will insert new instructions after the given instruction iterator.
it | The iterator to set the insertion point to |
Definition at line 20 of file IRBuilder.h.
|
inline |
Set the insertion point to the given instruction. This will insert new instructions after the given instruction.
instr | The instruction to set the insertion point to |
Definition at line 28 of file IRBuilder.h.