15 #ifndef LLVM_LTO_CONFIG_H
16 #define LLVM_LTO_CONFIG_H
28 class ModuleSummaryIndex;
29 class raw_pwrite_stream;
104 typedef std::function<bool(unsigned Task, const Module &)>
ModuleHookFn;
137 typedef std::function<bool(const ModuleSummaryIndex &Index)>
157 bool UseInputModulePath =
false);
CodeGenOpt::Level CGOptLevel
bool ShouldDiscardValueNames
std::string OverrideTriple
Setting this field will replace target triples in input files with this triple.
bool CodeGenOnly
Disable entirely the optimizer, including importing for ThinLTO.
void enableDebugTypeODRUniquing()
std::unique_ptr< raw_ostream > ResolutionFile
If this field is set, LTO will write input file paths and symbol resolutions here in llvm-lto2 comman...
ModuleHookFn PreCodeGenModuleHook
This module hook is called before code generation.
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
CombinedIndexHookFn CombinedIndexHook
static void funcDiagHandler(const DiagnosticInfo &DI, void *Context)
std::vector< std::string > MAttrs
std::function< bool(unsigned Task, const Module &)> ModuleHookFn
The following callbacks deal with tasks, which normally represent the entire optimization and code ge...
std::function< bool(const ModuleSummaryIndex &Index)> CombinedIndexHookFn
A combined index hook is called after all per-module indexes have been combined (ThinLTO-specific).
std::string SampleProfile
Sample PGO profile path.
ModuleHookFn PreOptModuleHook
This module hook is called after linking (regular LTO) or loading (ThinLTO) the module, before modifying it.
This is the base abstract class for diagnostic reporting in the backend.
This is an important class for using LLVM in a threaded context.
std::string DefaultTriple
Setting this field will replace unspecified target triples in input files with this triple...
DiagnosticHandlerFunction DiagHandler
ModuleHookFn PostInternalizeModuleHook
This hook is called after internalizing the module.
std::function< void(const DiagnosticInfo &)> DiagnosticHandlerFunction
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
std::string OptPipeline
If this field is set, the set of passes run in the middle-end optimizer will be the one specified by ...
DiagnosticHandlerFunction DiagHandler
LTOLLVMContext(const Config &C)
CodeModel::Model CodeModel
void setDiagnosticHandler(DiagnosticHandlerTy DiagHandler, void *DiagContext=nullptr, bool RespectFilters=false)
setDiagnosticHandler - This method sets a handler that is invoked when the backend needs to report an...
ModuleHookFn PostImportModuleHook
This hook is called after importing from other modules (ThinLTO-specific).
Lightweight error class with error context and mandatory checking.
ModuleHookFn PostOptModuleHook
This module hook is called after optimization is complete.
Error addSaveTemps(std::string OutputFileName, bool UseInputModulePath=false)
This is a convenience function that configures this Config object to write temporary files named afte...
A derived class of LLVMContext that initializes itself according to a given Config object...
ModuleHookFn PostPromoteModuleHook
This hook is called after promoting any internal functions (ThinLTO-specific).