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