clang
10.0.0git
|
CodeGenOptions - Track various options which control how the code is optimized and passed to the backend. More...
#include "clang/Basic/CodeGenOptions.h"
Classes | |
struct | BitcodeFileToLink |
Public Member Functions | |
CodeGenOptions () | |
bool | isNoBuiltinFunc (const char *Name) const |
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* option has been specified? More... | |
const std::vector< std::string > & | getNoBuiltinFuncs () const |
bool | hasProfileClangInstr () const |
Check if Clang profile instrumenation is on. More... | |
bool | hasProfileIRInstr () const |
Check if IR level profile instrumentation is on. More... | |
bool | hasProfileCSIRInstr () const |
Check if CS IR level profile instrumentation is on. More... | |
bool | hasProfileClangUse () const |
Check if Clang profile use is on. More... | |
bool | hasProfileIRUse () const |
Check if IR level profile use is on. More... | |
bool | hasProfileCSIRUse () const |
Check if CSIR profile use is on. More... | |
bool | hasReducedDebugInfo () const |
Check if type and variable info should be emitted. More... | |
Public Attributes | |
std::string | CodeModel |
The code model to use (-mcmodel). More... | |
std::string | CoverageDataFile |
The filename with path we use for coverage data files. More... | |
std::string | CoverageNotesFile |
The filename with path we use for coverage notes files. More... | |
std::string | ProfileFilterFiles |
Regexes separated by a semi-colon to filter the files to instrument. More... | |
std::string | ProfileExcludeFiles |
Regexes separated by a semi-colon to filter the files to not instrument. More... | |
char | CoverageVersion [4] |
The version string to put into coverage files. More... | |
std::string | DebugPass |
Enable additional debugging information. More... | |
std::string | DebugCompilationDir |
The string to embed in debug information as the current working directory. More... | |
std::string | DwarfDebugFlags |
The string to embed in the debug information for the compile unit, if non-empty. More... | |
std::string | RecordCommandLine |
The string containing the commandline for the llvm.commandline metadata, if non-empty. More... | |
std::map< std::string, std::string > | DebugPrefixMap |
std::string | FloatABI |
The ABI to use for passing floating point arguments. More... | |
llvm::DenormalMode | FPDenormalMode = llvm::DenormalMode::Invalid |
The floating-point denormal mode to use. More... | |
std::string | LimitFloatPrecision |
The float precision limit to use, if non-empty. More... | |
std::vector< BitcodeFileToLink > | LinkBitcodeFiles |
The files specified here are linked in to the module before optimizations. More... | |
std::string | MainFileName |
The user provided name for the "main file", if non-empty. More... | |
std::string | SplitDwarfFile |
The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU. More... | |
std::string | SplitDwarfOutput |
Output filename for the split debug info, not used in the skeleton CU. More... | |
llvm::Reloc::Model | RelocationModel |
The name of the relocation model to use. More... | |
std::string | ThreadModel |
The thread model to use. More... | |
std::string | TrapFuncName |
If not an empty string, trap intrinsics are lowered to calls to this function instead of to trap instructions. More... | |
std::vector< std::string > | DependentLibraries |
A list of dependent libraries. More... | |
std::vector< std::string > | LinkerOptions |
A list of linker options to embed in the object file. More... | |
std::string | InstrProfileOutput |
Name of the profile file to use as output for -fprofile-instr-generate, -fprofile-generate, and -fcs-profile-generate. More... | |
std::string | SampleProfileFile |
Name of the profile file to use with -fprofile-sample-use. More... | |
std::string | ProfileInstrumentUsePath |
Name of the profile file to use as input for -fprofile-instr-use. More... | |
std::string | ProfileRemappingFile |
Name of the profile remapping file to apply to the profile data supplied by -fprofile-sample-use or -fprofile-instr-use. More... | |
std::string | ThinLTOIndexFile |
Name of the function summary index file to use for ThinLTO function importing. More... | |
std::string | ThinLinkBitcodeFile |
Name of a file that can optionally be written with minimized bitcode to be used as input for the ThinLTO thin link step, which only needs the summary and module symbol table (and not, e.g. More... | |
std::string | SaveTempsFilePrefix |
Prefix to use for -save-temps output. More... | |
std::string | CudaGpuBinaryFileName |
Name of file passed with -fcuda-include-gpubinary option to forward to CUDA runtime back-end for incorporating them into host-side object file. More... | |
std::string | OptRecordFile |
The name of the file to which the backend should save YAML optimization records. More... | |
std::string | OptRecordPasses |
The regex that filters the passes that should be saved to the optimization records. More... | |
std::string | OptRecordFormat |
The format used for serializing remarks (default: YAML) More... | |
std::string | SymbolPartition |
The name of the partition that symbols are assigned to, specified with -fsymbol-partition (see https://lld.llvm.org/Partitions.html). More... | |
std::shared_ptr< llvm::Regex > | OptimizationRemarkPattern |
Regular expression to select optimizations for which we should enable optimization remarks. More... | |
std::shared_ptr< llvm::Regex > | OptimizationRemarkMissedPattern |
Regular expression to select optimizations for which we should enable missed optimization remarks. More... | |
std::shared_ptr< llvm::Regex > | OptimizationRemarkAnalysisPattern |
Regular expression to select optimizations for which we should enable optimization analyses. More... | |
std::vector< std::string > | RewriteMapFiles |
Set of files defining the rules for the symbol rewriting. More... | |
SanitizerSet | SanitizeRecover |
Set of sanitizer checks that are non-fatal (i.e. More... | |
SanitizerSet | SanitizeTrap |
Set of sanitizer checks that trap rather than diagnose. More... | |
std::vector< uint8_t > | CmdArgs |
List of backend command-line options for -fembed-bitcode. More... | |
std::vector< std::string > | NoBuiltinFuncs |
A list of all -fno-builtin-* function names (e.g., memset). More... | |
std::vector< std::string > | Reciprocals |
std::string | PreferVectorWidth |
The preferred width for auto-vectorization transforms. More... | |
XRayInstrSet | XRayInstrumentationBundle |
Set of XRay instrumentation kinds to emit. More... | |
std::vector< std::string > | DefaultFunctionAttrs |
std::vector< std::string > | PassPlugins |
List of dynamic shared object files to be loaded as pass plugins. More... | |
CodeGenOptions - Track various options which control how the code is optimized and passed to the backend.
Definition at line 46 of file CodeGenOptions.h.
|
strong |
Clang versions with different platform ABI conformance.
Definition at line 76 of file CodeGenOptions.h.
Enumerator | |
---|---|
Embed_Off | |
Embed_All | |
Embed_Bitcode | |
Embed_Marker |
Definition at line 106 of file CodeGenOptions.h.
|
strong |
Enumerator | |
---|---|
None | |
NonLeaf | |
All |
Definition at line 121 of file CodeGenOptions.h.
Enumerator | |
---|---|
NormalInlining | |
OnlyHintInlining | |
OnlyAlwaysInlining |
Definition at line 48 of file CodeGenOptions.h.
Enumerator | |
---|---|
Legacy | |
NonLegacy | |
Mixed |
Definition at line 62 of file CodeGenOptions.h.
Enumerator | |
---|---|
ProfileNone | |
ProfileClangInstr | |
ProfileIRInstr | |
ProfileCSIRInstr |
Definition at line 98 of file CodeGenOptions.h.
|
strong |
Enumerator | |
---|---|
AKey | |
BKey |
Definition at line 119 of file CodeGenOptions.h.
|
strong |
Enumerator | |
---|---|
None | |
NonLeaf | |
All |
Definition at line 113 of file CodeGenOptions.h.
Enumerator | |
---|---|
SRCK_Default | |
SRCK_OnStack | |
SRCK_InRegs |
Definition at line 92 of file CodeGenOptions.h.
Enumerator | |
---|---|
GeneralDynamicTLSModel | |
LocalDynamicTLSModel | |
InitialExecTLSModel | |
LocalExecTLSModel |
Definition at line 68 of file CodeGenOptions.h.
Enumerator | |
---|---|
NoLibrary | |
Accelerate | |
MASSV | |
SVML |
Definition at line 54 of file CodeGenOptions.h.
clang::CodeGenOptions::CodeGenOptions | ( | ) |
Definition at line 14 of file CodeGenOptions.cpp.
References CoverageVersion, memcpy(), and RelocationModel.
|
inline |
Definition at line 328 of file CodeGenOptions.h.
|
inline |
Check if Clang profile instrumenation is on.
Definition at line 333 of file CodeGenOptions.h.
Referenced by getInstrProfOptions(), and clang::CodeGen::CodeGenFunction::incrementProfileCounter().
|
inline |
Check if Clang profile use is on.
Definition at line 348 of file CodeGenOptions.h.
|
inline |
Check if CS IR level profile instrumentation is on.
Definition at line 343 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
|
inline |
Check if CSIR profile use is on.
Definition at line 359 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
|
inline |
Check if IR level profile instrumentation is on.
Definition at line 338 of file CodeGenOptions.h.
|
inline |
Check if IR level profile use is on.
Definition at line 353 of file CodeGenOptions.h.
|
inline |
Check if type and variable info should be emitted.
Definition at line 362 of file CodeGenOptions.h.
References clang::codegenoptions::DebugInfoConstructor.
Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
bool clang::CodeGenOptions::isNoBuiltinFunc | ( | const char * | Name | ) | const |
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* option has been specified?
Definition at line 23 of file CodeGenOptions.cpp.
std::vector<uint8_t> clang::CodeGenOptions::CmdArgs |
List of backend command-line options for -fembed-bitcode.
Definition at line 294 of file CodeGenOptions.h.
Referenced by clang::EmbedBitcode().
std::string clang::CodeGenOptions::CodeModel |
The code model to use (-mcmodel).
Definition at line 128 of file CodeGenOptions.h.
Referenced by getCodeModel(), and clang::CodeGen::CodeGenModule::Release().
std::string clang::CodeGenOptions::CoverageDataFile |
The filename with path we use for coverage data files.
The runtime allows further manipulation with the GCOV_PREFIX and GCOV_PREFIX_STRIP environment variables.
Definition at line 133 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::CoverageNotesFile |
The filename with path we use for coverage notes files.
Definition at line 136 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenModule::lookupRepresentativeDecl().
char clang::CodeGenOptions::CoverageVersion[4] |
The version string to put into coverage files.
Definition at line 145 of file CodeGenOptions.h.
Referenced by CodeGenOptions().
std::string clang::CodeGenOptions::CudaGpuBinaryFileName |
Name of file passed with -fcuda-include-gpubinary option to forward to CUDA runtime back-end for incorporating them into host-side object file.
Definition at line 244 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::DebugCompilationDir |
The string to embed in debug information as the current working directory.
Definition at line 151 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::DebugPass |
Enable additional debugging information.
Definition at line 148 of file CodeGenOptions.h.
Referenced by setCommandLineOpts().
std::map<std::string, std::string> clang::CodeGenOptions::DebugPrefixMap |
Definition at line 161 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CGDebugInfo::CGDebugInfo().
std::vector<std::string> clang::CodeGenOptions::DefaultFunctionAttrs |
Definition at line 309 of file CodeGenOptions.h.
std::vector<std::string> clang::CodeGenOptions::DependentLibraries |
A list of dependent libraries.
Definition at line 211 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::DwarfDebugFlags |
The string to embed in the debug information for the compile unit, if non-empty.
Definition at line 155 of file CodeGenOptions.h.
Referenced by SetUpDiagnosticLog().
std::string clang::CodeGenOptions::FloatABI |
The ABI to use for passing floating point arguments.
Definition at line 164 of file CodeGenOptions.h.
llvm::DenormalMode clang::CodeGenOptions::FPDenormalMode = llvm::DenormalMode::Invalid |
The floating-point denormal mode to use.
Definition at line 167 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::InstrProfileOutput |
Name of the profile file to use as output for -fprofile-instr-generate, -fprofile-generate, and -fcs-profile-generate.
Definition at line 218 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
std::string clang::CodeGenOptions::LimitFloatPrecision |
The float precision limit to use, if non-empty.
Definition at line 170 of file CodeGenOptions.h.
Referenced by setCommandLineOpts().
std::vector<BitcodeFileToLink> clang::CodeGenOptions::LinkBitcodeFiles |
The files specified here are linked in to the module before optimizations.
Definition at line 186 of file CodeGenOptions.h.
Referenced by clang::CodeGenAction::CreateASTConsumer().
std::vector<std::string> clang::CodeGenOptions::LinkerOptions |
A list of linker options to embed in the object file.
Definition at line 214 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::MainFileName |
The user provided name for the "main file", if non-empty.
This is useful in situations where the input file name does not match the original input file, for example with -save-temps.
Definition at line 191 of file CodeGenOptions.h.
std::vector<std::string> clang::CodeGenOptions::NoBuiltinFuncs |
A list of all -fno-builtin-* function names (e.g., memset).
Definition at line 297 of file CodeGenOptions.h.
std::shared_ptr<llvm::Regex> clang::CodeGenOptions::OptimizationRemarkAnalysisPattern |
Regular expression to select optimizations for which we should enable optimization analyses.
Transformation passes whose name matches this expression (and support this feature), will emit a diagnostic whenever they want to explain why they decided to apply or not apply a given transformation. This is enabled by the -Rpass-analysis=regexp flag.
Definition at line 281 of file CodeGenOptions.h.
std::shared_ptr<llvm::Regex> clang::CodeGenOptions::OptimizationRemarkMissedPattern |
Regular expression to select optimizations for which we should enable missed optimization remarks.
Transformation passes whose name matches this expression (and support this feature), will emit a diagnostic whenever they tried but failed to perform a transformation. This is enabled by the -Rpass-missed=regexp flag.
Definition at line 273 of file CodeGenOptions.h.
std::shared_ptr<llvm::Regex> clang::CodeGenOptions::OptimizationRemarkPattern |
Regular expression to select optimizations for which we should enable optimization remarks.
Transformation passes whose name matches this expression (and support this feature), will emit a diagnostic whenever they perform a transformation. This is enabled by the -Rpass=regexp flag.
Definition at line 266 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::OptRecordFile |
The name of the file to which the backend should save YAML optimization records.
Definition at line 248 of file CodeGenOptions.h.
Referenced by clang::reportOptRecordError(), and runThinLTOBackend().
std::string clang::CodeGenOptions::OptRecordFormat |
The format used for serializing remarks (default: YAML)
Definition at line 255 of file CodeGenOptions.h.
Referenced by clang::reportOptRecordError(), and runThinLTOBackend().
std::string clang::CodeGenOptions::OptRecordPasses |
The regex that filters the passes that should be saved to the optimization records.
Definition at line 252 of file CodeGenOptions.h.
Referenced by clang::reportOptRecordError(), and runThinLTOBackend().
std::vector<std::string> clang::CodeGenOptions::PassPlugins |
List of dynamic shared object files to be loaded as pass plugins.
Definition at line 312 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::PreferVectorWidth |
The preferred width for auto-vectorization transforms.
This is intended to override default transforms based on the width of the architected vector registers.
Definition at line 304 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::ProfileExcludeFiles |
Regexes separated by a semi-colon to filter the files to not instrument.
Definition at line 142 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::ProfileFilterFiles |
Regexes separated by a semi-colon to filter the files to instrument.
Definition at line 139 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::ProfileInstrumentUsePath |
Name of the profile file to use as input for -fprofile-instr-use.
Definition at line 224 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
std::string clang::CodeGenOptions::ProfileRemappingFile |
Name of the profile remapping file to apply to the profile data supplied by -fprofile-sample-use or -fprofile-instr-use.
Definition at line 228 of file CodeGenOptions.h.
std::vector<std::string> clang::CodeGenOptions::Reciprocals |
Definition at line 299 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::RecordCommandLine |
The string containing the commandline for the llvm.commandline metadata, if non-empty.
Definition at line 159 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenModule::lookupRepresentativeDecl().
llvm::Reloc::Model clang::CodeGenOptions::RelocationModel |
The name of the relocation model to use.
Definition at line 201 of file CodeGenOptions.h.
Referenced by CodeGenOptions(), runThinLTOBackend(), and shouldAssumeDSOLocal().
std::vector<std::string> clang::CodeGenOptions::RewriteMapFiles |
Set of files defining the rules for the symbol rewriting.
Definition at line 284 of file CodeGenOptions.h.
Referenced by addSymbolRewriterPass().
std::string clang::CodeGenOptions::SampleProfileFile |
Name of the profile file to use with -fprofile-sample-use.
Definition at line 221 of file CodeGenOptions.h.
SanitizerSet clang::CodeGenOptions::SanitizeRecover |
Set of sanitizer checks that are non-fatal (i.e.
execution should be continued when possible).
Definition at line 288 of file CodeGenOptions.h.
Referenced by addSanitizersAtO0(), and clang::CodeGen::CodeGenFunction::EmitCheck().
SanitizerSet clang::CodeGenOptions::SanitizeTrap |
Set of sanitizer checks that trap rather than diagnose.
Definition at line 291 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), and clang::CodeGen::CodeGenFunction::EmitCheck().
std::string clang::CodeGenOptions::SaveTempsFilePrefix |
Prefix to use for -save-temps output.
Definition at line 240 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
std::string clang::CodeGenOptions::SplitDwarfFile |
The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU.
Definition at line 195 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
std::string clang::CodeGenOptions::SplitDwarfOutput |
Output filename for the split debug info, not used in the skeleton CU.
Definition at line 198 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
std::string clang::CodeGenOptions::SymbolPartition |
The name of the partition that symbols are assigned to, specified with -fsymbol-partition (see https://lld.llvm.org/Partitions.html).
Definition at line 259 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenModule::setGVPropertiesAux().
std::string clang::CodeGenOptions::ThinLinkBitcodeFile |
Name of a file that can optionally be written with minimized bitcode to be used as input for the ThinLTO thin link step, which only needs the summary and module symbol table (and not, e.g.
any debug metadata).
Definition at line 237 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::ThinLTOIndexFile |
Name of the function summary index file to use for ThinLTO function importing.
Definition at line 232 of file CodeGenOptions.h.
Referenced by runThinLTOBackend().
std::string clang::CodeGenOptions::ThreadModel |
The thread model to use.
Definition at line 204 of file CodeGenOptions.h.
std::string clang::CodeGenOptions::TrapFuncName |
If not an empty string, trap intrinsics are lowered to calls to this function instead of to trap instructions.
Definition at line 208 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitTrapCall().
XRayInstrSet clang::CodeGenOptions::XRayInstrumentationBundle |
Set of XRay instrumentation kinds to emit.
Definition at line 307 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenFunction::AlwaysEmitXRayCustomEvents(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayTypedEvents(), and clang::CodeGen::CodeGenFunction::StartFunction().