llvm::parseAssemblyInto

Parse LLVM Assembly into an existing Module or ModuleSummaryIndex.

Synopsis

Declared in <llvm/AsmParser/Parser.h>

bool
parseAssemblyInto(
    MemoryBufferRef F,
    Module* M,
    ModuleSummaryIndex* Index,
    SMDiagnostic& Err,
    SlotMapping* Slots = nullptr,
    DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) { return std::nullopt; },
    AsmParserContext* ParserContext = nullptr);

Description

This function is the low-level interface to the LLVM Assembly Parser. This is kept as an independent function instead of being inlined into parseAssembly for the convenience of interactive users that want to add recently parsed bits to an existing module.

Return Value

true on error.

Parameters

NameDescription
FThe MemoryBuffer containing assembly
MThe module to add data to.
IndexThe index to add data to.
ErrError result info.
SlotsThe optional slot mapping that will be initialized during parsing.
DataLayoutCallbackOverride datalayout in the llvm assembly.
ParserContextOptional context that records source locations.