15 #ifndef LLVM_LTO_CONFIG_H 16 #define LLVM_LTO_CONFIG_H 29 class ModuleSummaryIndex;
30 class raw_pwrite_stream;
136 typedef std::function<bool(unsigned Task, const Module &)>
ModuleHookFn;
169 typedef std::function<bool(const ModuleSummaryIndex &Index)>
189 bool UseInputModulePath =
false);
195 : Fn(DiagHandlerFn) {}
210 enableDebugTypeODRUniquing();
211 setDiagnosticHandler(
212 llvm::make_unique<LTOLLVMDiagnosticHandler>(&
DiagHandler),
true);
This is the base class for diagnostic handling in LLVM.
CodeGenOpt::Level CGOptLevel
This class represents lattice values for constants.
DiagnosticHandlerFunction * Fn
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.
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...
bool DebugPassManager
Whether to emit the pass manager debuggging informations.
ModuleHookFn PreCodeGenModuleHook
This module hook is called before code generation.
CombinedIndexHookFn CombinedIndexHook
bool RemarksWithHotness
Whether to emit optimization remarks with hotness informations.
std::string DwoDir
The directory to store .dwo files.
std::vector< std::string > MAttrs
std::string ProfileRemapping
Name remapping file for profile data.
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.
Optional< CodeModel::Model > CodeModel
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.
bool UseNewPM
Use the new pass manager.
std::string DefaultTriple
Setting this field will replace unspecified target triples in input files with this triple...
DiagnosticHandlerFunction DiagHandler
LTOLLVMDiagnosticHandler(DiagnosticHandlerFunction *DiagHandlerFn)
std::string StatsFile
Statistics output file path.
ModuleHookFn PostInternalizeModuleHook
This hook is called after internalizing the module.
TargetMachine::CodeGenFileType CGFileType
std::string RemarksFilename
Optimization remarks file path.
Optional< Reloc::Model > RelocModel
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
bool handleDiagnostics(const DiagnosticInfo &DI) override
Override handleDiagnostics to provide custom implementation.
LTOLLVMContext(const Config &C)
std::string DwoPath
The path to write a .dwo file to.
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...
bool Freestanding
Flag to indicate that the optimizer should not assume builtins are present on the target...
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
ModuleHookFn PostPromoteModuleHook
This hook is called after promoting any internal functions (ThinLTO-specific).
std::function< void(const DiagnosticInfo &)> DiagnosticHandlerFunction