struct LTOCodeGenerator

Declaration

struct LTOCodeGenerator { /* full declaration omitted */ };

Description

C++ class which implements the opaque lto_code_gen_t type.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:70

Method Overview

Methods

void DiagnosticHandler(
    const llvm::DiagnosticInfo& DI)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:191

Parameters

const llvm::DiagnosticInfo& DI

LTOCodeGenerator(llvm::LLVMContext& Context)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:73

Parameters

llvm::LLVMContext& Context

bool addModule(struct LTOModule*)

Description

Merge given module. Return true on success. Resets \a HasVerifiedInput.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:79

Parameters

struct LTOModule*

void addMustPreserveSymbol(llvm::StringRef Sym)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:118

Parameters

llvm::StringRef Sym

std::unique_ptr<MemoryBuffer> compile(
    bool DisableVerify,
    bool DisableInline,
    bool DisableGVNLoadPRE,
    bool DisableVectorization)

Description

As with compile_to_file(), this function compiles the merged module into single output file. Instead of returning the output file path to the caller (linker), it brings the output to a buffer, and returns the buffer to the caller. This function should delete the intermediate file once its content is brought to memory. Return NULL if the compilation was not successful.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:158

Parameters

bool DisableVerify
bool DisableInline
bool DisableGVNLoadPRE
bool DisableVectorization

bool compileOptimized(
    ArrayRef<llvm::raw_pwrite_stream*> Out)

Description

Compile the merged optimized module into out.size() output files each representing a linkable partition of the module. If out contains more than one element, code generation is done in parallel with out.size() threads. Output files will be written to members of out. Returns true on success. Calls \a verifyMergedModuleOnce().

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:180

Parameters

ArrayRef<llvm::raw_pwrite_stream*> Out

std::unique_ptr<MemoryBuffer> compileOptimized()

Description

Compiles the merged optimized module into a single output file. It brings the output to a buffer, and returns the buffer to the caller. Return NULL if the compilation was not successful.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:171

bool compile_to_file(const char** Name,
                     bool DisableVerify,
                     bool DisableInline,
                     bool DisableGVNLoadPRE,
                     bool DisableVectorization)

Description

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.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:148

Parameters

const char** Name
bool DisableVerify
bool DisableInline
bool DisableGVNLoadPRE
bool DisableVectorization

llvm::LLVMContext& getContext()

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:188

static const char* getVersionString()

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:71

bool optimize(bool DisableVerify,
              bool DisableInline,
              bool DisableGVNLoadPRE,
              bool DisableVectorization)

Description

Optimizes the merged module. Returns true on success. Calls \a verifyMergedModuleOnce().

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:165

Parameters

bool DisableVerify
bool DisableInline
bool DisableGVNLoadPRE
bool DisableVectorization

void parseCodeGenDebugOptions()

Description

Parse the options set in setCodeGenDebugOptions. Like \a setCodeGenDebugOptions(), this must be called before LTOCodeGenerator::compilexxx() and LTOCodeGenerator::writeMergedModules().

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:133

void resetMergedModule()

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:190

void setAsmUndefinedRefs(struct LTOModule*)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:86

Parameters

struct LTOModule*

void setAttr(llvm::StringRef MAttr)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:96

Parameters

llvm::StringRef MAttr

void setCodeGenDebugOptions(
    ArrayRef<const char*> Opts)

Description

Pass options to the driver and optimization passes. These options are not necessarily for debugging purpose (the function name is misleading). This function should be called before LTOCodeGenerator::compilexxx(), and LTOCodeGenerator::writeMergedModules().

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:126

Parameters

ArrayRef<const char*> Opts

void setCodePICModel(Optional<Reloc::Model> Model)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:89

Parameters

Optional<Reloc::Model> Model

void setCpu(llvm::StringRef MCpu)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:95

Parameters

llvm::StringRef MCpu

void setDebugInfo(lto_debug_model)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:88

Parameters

lto_debug_model

void setDiagnosticHandler(
    lto_diagnostic_handler_t,
    void*)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:186

Parameters

lto_diagnostic_handler_t
void*

void setFileType(llvm::CodeGenFileType FT)

Description

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

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:93

Parameters

llvm::CodeGenFileType FT

void setFreestanding(bool Enabled)

Description

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

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:184

Parameters

bool Enabled

void setModule(std::unique_ptr<LTOModule> M)

Description

Set the destination module. Resets \a HasVerifiedInput.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:84

Parameters

std::unique_ptr<LTOModule> M

void setOptLevel(unsigned int OptLevel)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:97

Parameters

unsigned int OptLevel

void setShouldEmbedUselists(bool Value)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:100

Parameters

bool Value

void setShouldInternalize(bool Value)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:99

Parameters

bool Value

void setShouldRestoreGlobalsLinkage(bool Value)

Description

Restore linkage of globals When set, the linkage of globals will be restored prior to code generation. That is, a global symbol that had external linkage prior to LTO will be emitted with external linkage again; and a local will remain local. Note that this option only affects the end result - globals may still be internalized in the process of LTO and may be modified and/or deleted where legal. The default behavior will internalize globals (unless on the preserve list) and, if parallel code generation is enabled, will externalize all locals.

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:114

Parameters

bool Value

void setTargetOptions(
    const llvm::TargetOptions& Options)

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:87

Parameters

const llvm::TargetOptions& Options

bool writeMergedModules(llvm::StringRef Path)

Description

Write the merged module to the file specified by the given path. Return true on success. Calls \a verifyMergedModuleOnce().

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:139

Parameters

llvm::StringRef Path

~LTOCodeGenerator()

Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:74