llvm::parseAssemblyFile

Parse LLVM Assembly from a file.

Synopsis

Declared in <llvm/AsmParser/Parser.h>

std::unique_ptr<Module>
parseAssemblyFile(
    StringRef Filename,
    SMDiagnostic& Err,
    LLVMContext& Context,
    SlotMapping* Slots = nullptr);

Description

This function is a main interface to the LLVM Assembly Parser. It parses an ASCII file that (presumably) contains LLVM Assembly code. It returns a Module (intermediate representation) with the corresponding features. Note that this does not verify that the generated Module is valid, so you should run the verifier after parsing the file to check that it is okay.

Return Value

The parsed Module, or null on error.

Parameters

NameDescription
FilenameThe name of the file to parse
ErrError result info.
ContextContext in which to allocate globals info.
SlotsThe optional slot mapping that will be initialized during parsing.