llvm::lto::thinBackend

Runs a ThinLTO backend.

Synopsis

Declared in <llvm/LTO/LTOBackend.h>

Error
thinBackend(
    Config const& C,
    unsigned int Task,
    AddStreamFn AddStream,
    Module& M,
    ModuleSummaryIndex const& CombinedIndex,
    FunctionImporter::ImportMapTy const& ImportList,
    GVSummaryMapTy const& DefinedGlobals,
    MapVector<StringRef, BitcodeModule>* ModuleMap,
    bool CodeGenOnly,
    ArrayRef<StringRef> BitcodeLibFuncs,
    AddStreamFn IRAddStream = nullptr,
    std::vector<uint8_t> const& CmdArgs = std::vector<uint8_t>());

Description

If ModuleMap is not nullptr, all the module files to be imported have already been mapped to memory and the corresponding BitcodeModule objects are saved in the ModuleMap. If ModuleMap is nullptr, module files will be mapped to memory on demand and at any given time during importing, only one source module will be kept open at the most. If CodeGenOnly is true, the backend will skip optimization and only perform code generation. If IRAddStream is not nullptr, it will be called just before code generation to serialize the optimized IR.

Return Value

Success, or an error from importing, optimization, or code generation.

Parameters

NameDescription
CLTO configuration for optimization and code generation.
TaskTask identifier for this ThinLTO backend partition.
AddStreamCallback that creates an output stream for generated code.
MModule to optimize, import into, and code-generate.
CombinedIndexCombined module summary index for the link.
ImportListMap of source modules and GUIDs to import into M.
DefinedGlobalsSummaries of globals defined in M.
ModuleMapOptional map of already-loaded BitcodeModule objects keyed by module path; null loads modules on demand.
CodeGenOnlyWhether to skip optimization and only run code generation.
BitcodeLibFuncsNames of bitcode runtime library functions.
IRAddStreamOptional callback invoked to serialize optimized IR before code generation.
CmdArgsCommand-line arguments optionally embedded in the module.