Parse LLVM Assembly from a MemoryBuffer.
Declared in <llvm/AsmParser/Parser.h>
std::unique_ptr<Module>
parseAssembly(
MemoryBufferRef F,
SMDiagnostic& Err,
LLVMContext& Context,
SlotMapping* Slots = nullptr,
DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) { return std::nullopt; },
AsmParserContext* ParserContext = nullptr);
parseAssemblyFile and parseAssemblyString are wrappers around this function.
The parsed Module, or null on error.
| Name | Description |
|---|---|
| F | The MemoryBuffer containing assembly |
| Err | Error result info. |
| Context | Context in which to allocate globals info. |
| Slots | The optional slot mapping that will be initialized during parsing. |
| DataLayoutCallback | Override datalayout in the llvm assembly. |
| ParserContext | Optional context that records source locations. |