public void Insert(LlvmValue instruction) { // Register the instruction locally. this.instructions.Add(instruction); // Append the instruction to the reference builder. LLVM.InsertIntoBuilder(this.reference, instruction.Unwrap()); }
public LlvmValue CreateReturn(LlvmValue value) { // Invoke the native function and capture the resulting reference. LLVMValueRef reference = LLVM.BuildRet(this.reference, value.Unwrap()); // Register the instruction. this.instructions.Add(reference.Wrap()); // Wrap and return the reference. return(new LlvmValue(reference)); }
public LlvmValue CreateAdd(LlvmValue leftSide, LlvmValue rightSide, string resultIdentifier) { // Invoke the native function and capture the resulting reference. LLVMValueRef reference = LLVM.BuildAdd(this.reference, leftSide.Unwrap(), rightSide.Unwrap(), resultIdentifier); // Register the instruction. this.instructions.Add(reference.Wrap()); // Wrap and return the reference. return(new LlvmValue(reference)); }
public void SetInitialValue(LlvmValue value) { // Set the reference's initial value. LLVM.SetInitializer(this.reference, value.Unwrap()); }
public void PositionAt(LlvmValue instruction) { LLVM.PositionBuilder(this.reference, this.Block.Unwrap(), instruction.Unwrap()); }