Parse LLVM Assembly and its module summary from a file.
Declared in <llvm/AsmParser/Parser.h>
ParsedModuleAndIndex
parseAssemblyFileWithIndex(
StringRef Filename,
SMDiagnostic& Err,
LLVMContext& Context,
SlotMapping* Slots = nullptr,
DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
return std::nullopt;
});
This function is a main interface to the LLVM Assembly Parser. It parses an ASCII file that (presumably) contains LLVM Assembly code, including a module summary. It returns a Module (intermediate representation) and a ModuleSummaryIndex with the corresponding features. Note that this does not verify that the generated Module or Index are valid, so you should run the verifier after parsing the file to check that they are okay.
The parsed Module and ModuleSummaryIndex.
| Name | Description |
|---|---|
| Filename | The name of the file to parse |
| 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. |