C++ class which implements the opaque lto_code_gen_t type.

Synopsis

Declared in <llvm/LTO/legacy/LTOCodeGenerator.h>

struct LTOCodeGenerator;

Member Functions

Name

Description

LTOCodeGenerator [constructor]

Construct an LTO code generator that uses the given LLVM context.

~LTOCodeGenerator [destructor]

Destroy this LTO code generator.

DiagnosticHandler

Forward an LLVM diagnostic to the external LTO diagnostic handler.

addModule

Merge given module. Return true on success.

addMustPreserveSymbol

Record a symbol that must be preserved during LTO.

compile

Optimize and compile the merged module into a single in‐memory buffer.

compileOptimized

compileOptimized overloads

compile_to_file

Compile the merged module into a single output file; the path to output file is returned to the caller via argument "name". Return true on success.

getContext

Return the LLVM context used by this code generator.

optimize

Optimizes the merged module. Returns true on success.

parseCodeGenDebugOptions

Parse the options set in setCodeGenDebugOptions.

resetMergedModule

Destroy the merged module, releasing ownership of it.

setAsmUndefinedRefs

Record assembly undefined references from the given module.

setAttrs

Set the target feature attributes for code generation.

setCodeGenDebugOptions

Pass options to the driver and optimization passes.

setCodePICModel

Set the relocation model for code generation.

setCpu

Set the target CPU name for code generation.

setDebugInfo

Set the debug‐info model to emit.

setDebugPassManager

Enable or disable debug output from the pass manager.

setDiagnosticHandler

Set the external diagnostic handler callback and its context.

setDisableVerify

Enable or disable IR verification during LTO.

setFileType

Set the file type to be emitted (assembly or object code). The default is CodeGenFileType::ObjectFile.

setFreestanding

Enable the Freestanding mode: indicate that the optimizer should not assume builtins are present on the target.

setModule

Set the destination module.

setOptLevel

Set the optimization level used for LTO and code generation.

setSaveIRBeforeOptPath

Set the path where IR is saved before optimization, if any.

setShouldEmbedUselists

Set whether to embed use‐lists when writing bitcode.

setShouldInternalize

Set whether LTO should internalize unreferenced globals.

setShouldRestoreGlobalsLinkage

Restore linkage of globals

setTargetOptions

Set the target options used for code generation.

writeMergedModules

Write the merged module to the file specified by the given path. Return true on success.

Static Member Functions

Name

Description

getVersionString

Return a string identifying the LTO library version.

Created with MrDocs