llvm::parseAssembly

Parse LLVM Assembly from a MemoryBuffer.

Synopsis

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);

Description

parseAssemblyFile and parseAssemblyString are wrappers around this function.

Return Value

The parsed Module, or null on error.

Parameters

NameDescription
FThe MemoryBuffer containing assembly
ErrError result info.
ContextContext in which to allocate globals info.
SlotsThe optional slot mapping that will be initialized during parsing.
DataLayoutCallbackOverride datalayout in the llvm assembly.
ParserContextOptional context that records source locations.