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()); }
public bool Run(Module m) => LLVM.RunPassManager(this.Unwrap(), m.Unwrap());
public static PassManager Create(Module module) => LLVM.CreateFunctionPassManagerForModule(module.Unwrap()).Wrap().MakeHandleOwner <PassManager, LLVMPassManagerRef>();
public bool EmitToFile(Module m, IntPtr filename, LLVMCodeGenFileType codegen, out IntPtr errorMessage) => LLVM.TargetMachineEmitToFile(this.Unwrap(), m.Unwrap(), filename, codegen, out errorMessage);
public Module RemoveModule(Module m) { LLVM.RemoveModule(this.Unwrap(), m.Unwrap(), out LLVMModuleRef outModRef, out IntPtr outError); this.DisassosicateWithModule(m); return(outModRef.Wrap()); }
public void AddModule(Module m) { LLVM.AddModule(this.Unwrap(), m.Unwrap()); this.AssociateWithModule(m); }