示例#1
0
        public LlvmFunction?NativeGetFunction(string identifier)
        {
            // Attempt to retrieve the function.
            LLVMValueRef reference = LLVM.GetNamedFunction(this.reference, identifier);

            // If the reference's pointer is null, the function does not exist. Return null.
            if (LlvmUtil.IsPointerNull(reference.Pointer))
            {
                return(null);
            }

            // Otherwise, wrap and return the reference.
            return(new LlvmFunction(this, reference));
        }
示例#2
0
        public LlvmValue GetFirstInstruction()
        {
            // Attempt to retrieve the first instruction.
            LLVMValueRef firstInstruction = LLVM.GetFirstInstruction(this.Block.Unwrap());

            // No instructions.
            if (LlvmUtil.IsPointerNull(firstInstruction.Pointer))
            {
                return(null);
            }

            // Create and return an instruction wrapper instance.
            return(firstInstruction.Wrap());
        }