Пример #1
0
        public MemoryBuffer EmitToMemoryBuffer(Module m, LLVMCodeGenFileType codegen)
        {
            if (LLVM.TargetMachineEmitToMemoryBuffer(this.Unwrap(), m.Unwrap(), codegen, out IntPtr error, out LLVMMemoryBufferRef buf).Failed())
            {
                TextUtilities.Throw(error);
            }

            return(buf.Wrap());
        }
Пример #2
0
 public bool Run(Module m) => LLVM.RunPassManager(this.Unwrap(), m.Unwrap());
Пример #3
0
 public static PassManager Create(Module module) => LLVM.CreateFunctionPassManagerForModule(module.Unwrap()).Wrap().MakeHandleOwner <PassManager, LLVMPassManagerRef>();
Пример #4
0
 public bool EmitToFile(Module m, IntPtr filename, LLVMCodeGenFileType codegen, out IntPtr errorMessage) => LLVM.TargetMachineEmitToFile(this.Unwrap(), m.Unwrap(), filename, codegen, out errorMessage);
Пример #5
0
 public Module RemoveModule(Module m)
 {
     LLVM.RemoveModule(this.Unwrap(), m.Unwrap(), out LLVMModuleRef outModRef, out IntPtr outError);
     this.DisassosicateWithModule(m);
     return(outModRef.Wrap());
 }
Пример #6
0
 public void AddModule(Module m)
 {
     LLVM.AddModule(this.Unwrap(), m.Unwrap());
     this.AssociateWithModule(m);
 }