If the given MemoryBuffer holds a bitcode image, return a Module for it. Otherwise, attempt to parse it as LLVM Assembly and return a Module for it.
Declared in <llvm/IRReader/IRReader.h>
std::unique_ptr<Module>
parseIR(
MemoryBufferRef Buffer,
SMDiagnostic& Err,
LLVMContext& Context,
ParserCallbacks Callbacks = {},
AsmParserContext* ParserContext = nullptr);
A Module for the buffer contents, or nullptr on error.
| Name | Description |
|---|---|
| Buffer | Memory buffer containing bitcode or LLVM assembly. |
| Err | Error result info. |
| Context | Context in which to allocate globals info. |
| Callbacks | Optional parser customization callbacks. |
| ParserContext | Optional context that records source locations. |