If the given file holds a bitcode image, return a Module for it. Otherwise, attempt to parse it as LLVM Assembly and return a Module for it.
Declared in <llvm/IRReader/IRReader.h>
std::unique_ptr<Module>
parseIRFile(
StringRef Filename,
SMDiagnostic& Err,
LLVMContext& Context,
ParserCallbacks Callbacks = {},
AsmParserContext* ParserContext = nullptr);
A Module for the file contents, or nullptr on error.
| Name | Description |
|---|---|
| Filename | Path to the file containing bitcode or LLVM assembly. |
| Err | Error result info. |
| Context | Context in which to allocate globals info. |
| Callbacks | Optional parser customization callbacks. |
| ParserContext | Optional context that records source locations. |