50 *OutMessage = strdup(Message.c_str());
55 *OutModule =
wrap(ModuleOrErr.
get().release());
72 *OutModule =
wrap(ModuleOrErr.
get().release());
83 std::unique_ptr<MemoryBuffer> Owner(
unwrap(MemBuf));
88 (void)Owner.release();
96 *OutMessage = strdup(Message.c_str());
101 *OutM =
wrap(ModuleOrErr.
get().release());
110 std::unique_ptr<MemoryBuffer> Owner(
unwrap(MemBuf));
121 *OutM =
wrap(ModuleOrErr.
get().release());
Represents either an error or a value T.
This class represents lattice values for constants.
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 ...
virtual std::string message() const
Return the error message as a string.
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.
std::error_code getError() const
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule)
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
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.
LLVMContextRef LLVMGetGlobalContext(void)
Obtain the global context instance.