Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 public void SetInitialValue(LlvmValue value)
 {
     // Set the reference's initial value.
     LLVM.SetInitializer(this.reference, value.Unwrap());
 }
Esempio n. 5
0
 public void PositionAt(LlvmValue instruction)
 {
     LLVM.PositionBuilder(this.reference, this.Block.Unwrap(), instruction.Unwrap());
 }