public static LLVMBool CreateMemoryBufferWithSTDIN(out LLVMMemoryBufferRef OutMemBuf, out string OutMessage) { var retVal = CreateMemoryBufferWithSTDIN(out OutMemBuf, out IntPtr message); OutMessage = message != IntPtr.Zero && retVal.Value != 0 ? Marshal.PtrToStringAnsi(message) : null; DisposeMessage(message); return(retVal); }
public static LLVMBool ParseIRInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage) { var retVal = ParseIRInContext(ContextRef, MemBuf, out OutM, out IntPtr message); OutMessage = message != IntPtr.Zero && retVal.Value != 0 ? Marshal.PtrToStringAnsi(message) : null; DisposeMessage(message); return(retVal); }
public static LLVMBool GetBitcodeModule(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage) { var retVal = GetBitcodeModule(MemBuf, out OutM, out IntPtr message); OutMessage = message != IntPtr.Zero && retVal.Value != 0 ? Marshal.PtrToStringAnsi(message) : null; DisposeMessage(message); return(retVal); }
public LLVMModuleRef ParseIR(LLVMMemoryBufferRef MemBuf) { if (!TryParseIR(MemBuf, out LLVMModuleRef M, out string Message)) { throw new ExternalException(Message); } return(M); }
public LLVMModuleRef GetBitcodeModule(LLVMMemoryBufferRef MemBuf) { if (!TryGetBitcodeModule(MemBuf, out LLVMModuleRef M, out string Message)) { throw new ExternalException(Message); } return(M); }
public bool TryParseIR(LLVMMemoryBufferRef MemBuf, out LLVMModuleRef OutM, out string OutMessage) { fixed(LLVMModuleRef *pOutM = &OutM) { sbyte *pMessage; var result = LLVM.ParseIRInContext(this, MemBuf, (LLVMOpaqueModule **)pOutM, &pMessage); if (pMessage is null) { OutMessage = string.Empty; } else { var span = new ReadOnlySpan <byte>(pMessage, int.MaxValue); OutMessage = span.Slice(0, span.IndexOf((byte)'\0')).AsString(); } return(result == 0); } }
public static extern int GetBufferSize(LLVMMemoryBufferRef @MemBuf);
public bool GetBitcodeModuleProviderInContext(LLVMMemoryBufferRef @MemBuf, out LLVMModuleProviderRef @OutMP, out IntPtr @OutMessage) { return LLVM.GetBitcodeModuleProviderInContext(this, @MemBuf, out @OutMP, out @OutMessage); }
public bool ParseIRInContext(LLVMMemoryBufferRef @MemBuf, out LLVMModuleRef @OutM, out IntPtr @OutMessage) { return LLVM.ParseIRInContext(this, @MemBuf, out @OutM, out @OutMessage); }
public static extern LLVMBool TargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef @T, LLVMModuleRef @M, LLVMCodeGenFileType @codegen, out IntPtr @ErrorMessage, out LLVMMemoryBufferRef @OutMemBuf);
public static extern LLVMBool ParseIRInContext(LLVMContextRef @ContextRef, LLVMMemoryBufferRef @MemBuf, out LLVMModuleRef @OutM, out IntPtr @OutMessage);
public bool GetBitcodeModuleInContext(LLVMMemoryBufferRef @MemBuf, out LLVMModuleRef @OutM, out IntPtr @OutMessage) { return(LLVM.GetBitcodeModuleInContext(this, @MemBuf, out @OutM, out @OutMessage)); }
public static LLVMBool TargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen, out string ErrorMessage, out LLVMMemoryBufferRef OutMemBuf) { var retVal = TargetMachineEmitToMemoryBuffer(T, M, codegen, out IntPtr message, out OutMemBuf); ErrorMessage = message != IntPtr.Zero && retVal.Value != 0 ? Marshal.PtrToStringAnsi(message) : null; DisposeMessage(message); return(retVal); }
public static extern LLVMBool GetBitcodeModuleProviderInContext(LLVMContextRef @ContextRef, LLVMMemoryBufferRef @MemBuf, out LLVMModuleProviderRef @OutMP, out IntPtr @OutMessage);
public static extern void DisposeMemoryBuffer(LLVMMemoryBufferRef @MemBuf);
public static extern LLVMObjectFileRef CreateObjectFile(LLVMMemoryBufferRef @MemBuf);
public static extern LLVMBool CreateMemoryBufferWithSTDIN(out LLVMMemoryBufferRef @OutMemBuf, out IntPtr @OutMessage);
public static extern LLVMBool CreateMemoryBufferWithContentsOfFile([MarshalAs(UnmanagedType.LPStr)] string @Path, out LLVMMemoryBufferRef @OutMemBuf, out IntPtr @OutMessage);
public static extern string GetBufferStart(LLVMMemoryBufferRef @MemBuf);
public static extern LLVMBool ParseBitcode(LLVMMemoryBufferRef @MemBuf, out LLVMModuleRef @OutModule, out IntPtr @OutMessage);
public bool ParseIRInContext(LLVMMemoryBufferRef @MemBuf, out LLVMModuleRef @OutM, out IntPtr @OutMessage) { return(LLVM.ParseIRInContext(this, @MemBuf, out @OutM, out @OutMessage)); }
public static extern IntPtr GetBufferStart(LLVMMemoryBufferRef MemBuf);