51 *OutMessage = strdup(Message.c_str());
56 *OutModule =
wrap(ModuleOrErr.
get().release());
73 *OutModule =
wrap(ModuleOrErr.
get().release());
84 std::unique_ptr<MemoryBuffer> Owner(
unwrap(MemBuf));
89 (void)Owner.release();
97 *OutMessage = strdup(Message.c_str());
102 *OutM =
wrap(ModuleOrErr.
get().release());
111 std::unique_ptr<MemoryBuffer> Owner(
unwrap(MemBuf));
122 *OutM =
wrap(ModuleOrErr.
get().release());
std::error_code getError() const
Represents either an error or a value T.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
A Module instance is used to store all the information related to an LLVM module. ...
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Error takeError()
Take ownership of the stored error.
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage)
Base class for error info classes.
LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule)
Attribute unwrap(LLVMAttributeRef Attr)
Tagged union holding either a T or a Error.
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage)
LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM)
Reads a module from the specified path, returning via the OutMP parameter a module provider which per...
This is an important class for using LLVM in a threaded context.
void handleAllErrors(Error E, HandlerTs &&...Handlers)
Behaves the same as handleErrors, except that it requires that all errors be handled by the given han...
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule)
Module.h This file contains the declarations for the Module class.
reference get()
Returns a reference to the stored T value.
Expected< std::unique_ptr< Module > > parseBitcodeFile(MemoryBufferRef Buffer, LLVMContext &Context)
Read the specified bitcode file, returning the module.
LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
Reads a module from the specified path, returning via the OutMP parameter a module provider which per...
ErrorOr< T > expectedToErrorOrAndEmitErrors(LLVMContext &Ctx, Expected< T > Val)
LLVMAttributeRef wrap(Attribute Attr)
LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM)
Expected< std::unique_ptr< Module > > getOwningLazyBitcodeModule(std::unique_ptr< MemoryBuffer > &&Buffer, LLVMContext &Context, bool ShouldLazyLoadMetadata=false, bool IsImporting=false)
Like getLazyBitcodeModule, except that the module takes ownership of the memory buffer if successful...
Lightweight error class with error context and mandatory checking.
virtual std::string message() const
Return the error message as a string.
LLVMContextRef LLVMGetGlobalContext(void)
Obtain the global context instance.