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
- public void DiagnosticHandler(const llvm::DiagnosticInfo & DI)
- public LTOCodeGenerator(llvm::LLVMContext & Context)
- public bool addModule(struct LTOModule *)
- public void addMustPreserveSymbol(llvm::StringRef Sym)
- public std::unique_ptr<MemoryBuffer> compile(bool DisableVerify, bool DisableInline, bool DisableGVNLoadPRE, bool DisableVectorization)
- public bool compileOptimized(ArrayRef<llvm::raw_pwrite_stream *> Out)
- public std::unique_ptr<MemoryBuffer> compileOptimized()
- public bool compile_to_file(const char ** Name, bool DisableVerify, bool DisableInline, bool DisableGVNLoadPRE, bool DisableVectorization)
- public llvm::LLVMContext & getContext()
- public static const char * getVersionString()
- public bool optimize(bool DisableVerify, bool DisableInline, bool DisableGVNLoadPRE, bool DisableVectorization)
- public void parseCodeGenDebugOptions()
- public void resetMergedModule()
- public void setAsmUndefinedRefs(struct LTOModule *)
- public void setAttr(llvm::StringRef MAttr)
- public void setCodeGenDebugOptions(ArrayRef<const char *> Opts)
- public void setCodePICModel(Optional<Reloc::Model> Model)
- public void setCpu(llvm::StringRef MCpu)
- public void setDebugInfo(lto_debug_model)
- public void setDiagnosticHandler(lto_diagnostic_handler_t, void *)
- public void setFileType(llvm::CodeGenFileType FT)
- public void setFreestanding(bool Enabled)
- public void setModule(std::unique_ptr<LTOModule> M)
- public void setOptLevel(unsigned int OptLevel)
- public void setShouldEmbedUselists(bool Value)
- public void setShouldInternalize(bool Value)
- public void setShouldRestoreGlobalsLinkage(bool Value)
- public void setTargetOptions(const llvm::TargetOptions & Options)
- public bool writeMergedModules(llvm::StringRef Path)
- public ~LTOCodeGenerator()
Methods
¶void DiagnosticHandler(
const llvm::DiagnosticInfo& DI)
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)
LTOCodeGenerator(llvm::LLVMContext& Context)
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:73
Parameters
- llvm::LLVMContext& Context
¶bool addModule(struct LTOModule*)
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)
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)
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)
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()
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)
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()
llvm::LLVMContext& getContext()
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:188
¶static const char* getVersionString()
static const char* getVersionString()
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:71
¶bool optimize(bool DisableVerify,
bool DisableInline,
bool DisableGVNLoadPRE,
bool DisableVectorization)
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()
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()
void resetMergedModule()
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:190
¶void setAsmUndefinedRefs(struct LTOModule*)
void setAsmUndefinedRefs(struct LTOModule*)
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:86
Parameters
- struct LTOModule*
¶void setAttr(llvm::StringRef MAttr)
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)
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)
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)
void setCpu(llvm::StringRef MCpu)
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:95
Parameters
- llvm::StringRef MCpu
¶void setDebugInfo(lto_debug_model)
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*)
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)
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)
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)
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)
void setOptLevel(unsigned int OptLevel)
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:97
Parameters
- unsigned int OptLevel
¶void setShouldEmbedUselists(bool Value)
void setShouldEmbedUselists(bool Value)
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:100
Parameters
- bool Value
¶void setShouldInternalize(bool Value)
void setShouldInternalize(bool Value)
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:99
Parameters
- bool Value
¶void setShouldRestoreGlobalsLinkage(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)
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)
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()
~LTOCodeGenerator()
Declared at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:74