Create a Module from a file, with lazy function‐body loading for bitcode.
Synopsis
Declared in <llvm/IRReader/IRReader.h>
std::unique_ptr<Module>
getLazyIRFileModule(
StringRef Filename,
SMDiagnostic& Err,
LLVMContext& Context,
bool ShouldLazyLoadMetadata = false);
Description
If the given file holds a bitcode image, return a Module for it which does lazy deserialization of function bodies. Otherwise, attempt to parse it as LLVM Assembly and return a fully populated Module. The ShouldLazyLoadMetadata flag is passed down to the bitcode reader to optionally enable lazy metadata loading.
Return Value
A Module with lazy function‐body loading for bitcode, or a fully populated Module for assembly; nullptr on error.
Parameters
Name |
Description |
Filename |
Path to the file containing bitcode or LLVM assembly. |
Err |
Error result info. |
Context |
Context in which to allocate globals info. |
ShouldLazyLoadMetadata |
If true, defer loading metadata for bitcode. |
Created with MrDocs