14 #ifndef LLVM_LTO_CONFIG_H 15 #define LLVM_LTO_CONFIG_H 31 class ModuleSummaryIndex;
32 class raw_pwrite_stream;
159 using ModuleHookFn = std::function<bool(unsigned Task, const Module &)>;
213 bool UseInputModulePath =
false);
219 : Fn(DiagHandlerFn) {}
234 enableDebugTypeODRUniquing();
235 setDiagnosticHandler(
236 std::make_unique<LTOLLVMDiagnosticHandler>(&
DiagHandler),
true);
This is the base class for diagnostic handling in LLVM.
Interfaces for registering analysis passes, producing common pass manager configurations, and parsing of pass pipelines.
CodeGenOpt::Level CGOptLevel
This class represents lattice values for constants.
std::function< bool(const ModuleSummaryIndex &Index, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols)> CombinedIndexHookFn
A combined index hook is called after all per-module indexes have been combined (ThinLTO-specific).
DiagnosticHandlerFunction * Fn
bool ShouldDiscardValueNames
Implements a dense probed hash-table based set.
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.
Tunable parameters for passes in the default pipelines.
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::string SplitDwarfFile
The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU...
std::string SampleProfile
Sample PGO profile path.
Optional< CodeModel::Model > CodeModel
Class to hold module path string table and global value map, and encapsulate methods for operating on...
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
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.
std::function< bool(unsigned Task, const Module &)> ModuleHookFn
The following callbacks deal with tasks, which normally represent the entire optimization and code ge...
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...
std::string CSIRProfile
Context Sensitive PGO profile path.
DiagnosticHandlerFunction DiagHandler
LTOLLVMDiagnosticHandler(DiagnosticHandlerFunction *DiagHandlerFn)
std::string StatsFile
Statistics output file path.
ModuleHookFn PostInternalizeModuleHook
This hook is called after internalizing the module.
std::string RemarksFilename
Optimization remarks file path.
bool RunCSIRInstr
Run PGO context sensitive IR instrumentation.
Optional< Reloc::Model > RelocModel
CodeGenFileType CGFileType
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
std::string RemarksFormat
The format used for serializing remarks (default: YAML).
bool handleDiagnostics(const DiagnosticInfo &DI) override
Override handleDiagnostics to provide custom implementation.
LTOLLVMContext(const Config &C)
std::string SplitDwarfOutput
The path to write a .dwo file to.
std::string RemarksPasses
Optimization remarks pass filter.
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...
print Print MemDeps of function
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...
PipelineTuningOptions PTO
Tunable parameters for passes in the default pipelines.
ModuleHookFn PostPromoteModuleHook
This hook is called after promoting any internal functions (ThinLTO-specific).
std::function< void(const DiagnosticInfo &)> DiagnosticHandlerFunction