clang API Documentation
#include <CodeGenOptions.h>
Public Types | |
enum | InliningMethod { NoInlining, NormalInlining, OnlyAlwaysInlining } |
enum | ObjCDispatchMethodKind { Legacy = 0, NonLegacy = 1, Mixed = 2 } |
enum | DebugInfoKind { NoDebugInfo, LocTrackingOnly, DebugLineTablesOnly, LimitedDebugInfo, FullDebugInfo } |
enum | TLSModel { GeneralDynamicTLSModel, LocalDynamicTLSModel, InitialExecTLSModel, LocalExecTLSModel } |
enum | FPContractModeKind { FPC_Off, FPC_On, FPC_Fast } |
enum | StructReturnConventionKind { SRCK_Default, SRCK_OnStack, SRCK_InRegs } |
Public Member Functions | |
CODEGENOPT (DisableIntegratedAS, 1, 0) CODEGENOPT(CompressDebugSections | |
CODEGENOPT (Autolink, 1, 1) CODEGENOPT(AsmVerbose | |
< -Wa,-compress-debug-sections | |
CODEGENOPT (ObjCAutoRefCountExceptions, 1, 0) CODEGENOPT(CoverageExtraChecksum | |
< -dA, -fverbose-asm. | |
CODEGENOPT (CoverageNoFunctionNamesInData, 1, 0) CODEGENOPT(CUDAIsDevice | |
< Whether we need a second checksum for functions in GCNO files. | |
CODEGENOPT (CXAAtExit, 1, 1) CODEGENOPT(CXXCtorDtorAliases | |
< Set when compiling for CUDA device. | |
CODEGENOPT (DataSections, 1, 0) CODEGENOPT(DisableFPElim | |
CODEGENOPT (DisableFree, 1, 0) CODEGENOPT(DisableGCov | |
< Set when -fomit-frame-pointer is enabled. | |
CODEGENOPT (DisableLLVMOpts, 1, 0) CODEGENOPT(DisableRedZone | |
< Don't run the GCov pass, for testing. | |
CODEGENOPT (DisableTailCalls, 1, 0) CODEGENOPT(EmitDeclMetadata | |
< Set when -mno-red-zone is enabled. | |
CODEGENOPT (EmitGcovArcs, 1, 0) CODEGENOPT(EmitGcovNotes | |
CODEGENOPT (EmitOpenCLArgMetadata, 1, 0) CODEGENOPT(ForbidGuardVariables | |
< Emit coverage "notes" files, aka GCNO. | |
CODEGENOPT (FunctionSections, 1, 0) CODEGENOPT(InstrumentFunctions | |
CODEGENOPT (InstrumentForProfiling, 1, 0) CODEGENOPT(LessPreciseFPMAD | |
CODEGENOPT (MergeAllConstants, 1, 1) CODEGENOPT(MergeFunctions | |
CODEGENOPT (NoCommon, 1, 0) CODEGENOPT(NoDwarfDirectoryAsm | |
< Set when -fmerge-functions is enabled. | |
CODEGENOPT (NoExecStack, 1, 0) CODEGENOPT(FatalWarnings | |
CODEGENOPT (EnableSegmentedStacks, 1, 0) CODEGENOPT(NoGlobalMerge | |
CODEGENOPT (NoImplicitFloat, 1, 0) CODEGENOPT(NoInfsFPMath | |
< Set when -mno-global-merge is enabled. | |
CODEGENOPT (NoInline, 1, 0) CODEGENOPT(NoNaNsFPMath | |
< Assume FP arguments, results not +-Inf. | |
CODEGENOPT (NoZeroInitializedInBSS, 1, 0) CODEGENOPT(OmitLeafFramePointer | |
< Assume FP arguments, results not NaN. | |
VALUE_CODEGENOPT (OptimizationLevel, 3, 0) VALUE_CODEGENOPT(OptimizeSize | |
CODEGENOPT (ProfileInstrGenerate, 1, 0) CODEGENOPT(CoverageMapping | |
< If -Os (==1) or -Oz (==2) is specified. | |
CODEGENOPT (DumpCoverageMapping, 1, 0) CODEGENOPT(RelaxAll | |
If -fpcc-struct-return or -freg-struct-return is specified. | |
CODEGENOPT (RelaxedAliasing, 1, 0) CODEGENOPT(StructPathTBAA | |
< Relax all machine code instructions. | |
CODEGENOPT (SaveTempLabels, 1, 0) CODEGENOPT(SanitizeAddressZeroBaseShadow | |
< Whether or not to use struct-path TBAA. | |
CODEGENOPT (SanitizeMemoryTrackOrigins, 2, 0) CODEGENOPT(SanitizeCoverage | |
CODEGENOPT (SanitizeUndefinedTrapOnError, 1, 0) CODEGENOPT(SimplifyLibCalls | |
< Enable sanitizer coverage instrumentation. | |
CODEGENOPT (SoftFloat, 1, 0) CODEGENOPT(StrictEnums | |
< Set when -fbuiltin is enabled. | |
CODEGENOPT (TimePasses, 1, 0) CODEGENOPT(UnitAtATime | |
< Optimize based on strict enum definition. | |
CODEGENOPT (UnrollLoops, 1, 0) CODEGENOPT(RerollLoops | |
CODEGENOPT (UnsafeFPMath, 1, 0) CODEGENOPT(UnwindTables | |
< Control whether loops are rerolled. | |
CODEGENOPT (VectorizeBB, 1, 0) CODEGENOPT(VectorizeLoop | |
< Emit unwind tables. | |
CODEGENOPT (VectorizeSLP, 1, 0) CODEGENOPT(VerifyModule | |
< Run loop vectorizer. | |
CODEGENOPT (StackRealignment, 1, 0) CODEGENOPT(UseInitArray | |
VALUE_CODEGENOPT (StackAlignment, 32, 0) CODEGENOPT(DebugColumnInfo | |
CODEGENOPT (SanitizeRecover, 1, 1) CodeGenOptions() | |
The lower bound for a buffer to be considered for stack protection. | |
Public Attributes | |
std::string | CodeModel |
The code model to use (-mcmodel). | |
std::string | CoverageFile |
char | CoverageVersion [4] |
The version string to put into coverage files. | |
std::string | DebugPass |
Enable additional debugging information. | |
std::string | DebugCompilationDir |
The string to embed in debug information as the current working directory. | |
std::string | DwarfDebugFlags |
std::string | FloatABI |
The ABI to use for passing floating point arguments. | |
std::string | LimitFloatPrecision |
The float precision limit to use, if non-empty. | |
std::string | LinkBitcodeFile |
The name of the bitcode file to link before optzns. | |
std::string | MainFileName |
std::string | SplitDwarfFile |
std::string | RelocationModel |
The name of the relocation model to use. | |
std::string | ThreadModel |
The thread model to use. | |
std::string | TrapFuncName |
std::vector< std::string > | BackendOptions |
A list of command-line options to forward to the LLVM backend. | |
std::vector< std::string > | DependentLibraries |
A list of dependent libraries. | |
std::string | SampleProfileFile |
Name of the profile file to use with -fprofile-sample-use. | |
std::string | InstrProfileInput |
Name of the profile file to use as input for -fprofile-instr-use. | |
std::shared_ptr< llvm::Regex > | OptimizationRemarkPattern |
std::shared_ptr< llvm::Regex > | OptimizationRemarkMissedPattern |
std::shared_ptr< llvm::Regex > | OptimizationRemarkAnalysisPattern |
CodeGenOptions - Track various options which control how the code is optimized and passed to the backend.
Definition at line 40 of file CodeGenOptions.h.
Definition at line 54 of file CodeGenOptions.h.
Definition at line 85 of file CodeGenOptions.h.
Definition at line 42 of file CodeGenOptions.h.
Definition at line 48 of file CodeGenOptions.h.
Definition at line 91 of file CodeGenOptions.h.
Definition at line 78 of file CodeGenOptions.h.
clang::CodeGenOptions::CODEGENOPT | ( | DisableIntegratedAS | , |
1 | , | ||
0 | |||
) |
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | Autolink | , |
1 | , | ||
1 | |||
) |
< -Wa,-compress-debug-sections
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | ObjCAutoRefCountExceptions | , |
1 | , | ||
0 | |||
) |
< -dA, -fverbose-asm.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | CoverageNoFunctionNamesInData | , |
1 | , | ||
0 | |||
) |
< Whether we need a second checksum for functions in GCNO files.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | CXAAtExit | , |
1 | , | ||
1 | |||
) |
< Set when compiling for CUDA device.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | DataSections | , |
1 | , | ||
0 | |||
) |
< Emit complete ctors/dtors as linker aliases to base ctors when possible.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | DisableFree | , |
1 | , | ||
0 | |||
) |
< Set when -fomit-frame-pointer is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | DisableLLVMOpts | , |
1 | , | ||
0 | |||
) |
< Don't run the GCov pass, for testing.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | DisableTailCalls | , |
1 | , | ||
0 | |||
) |
< Set when -mno-red-zone is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | EmitGcovArcs | , |
1 | , | ||
0 | |||
) |
< Emit special metadata indicating what Decl* various IR entities came from. Only useful when running CodeGen as a subroutine.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | EmitOpenCLArgMetadata | , |
1 | , | ||
0 | |||
) |
< Emit coverage "notes" files, aka GCNO.
FP_CONTRACT mode (on/off/fast).
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | FunctionSections | , |
1 | , | ||
0 | |||
) |
< Issue errors if C++ guard variables are required.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | InstrumentForProfiling | , |
1 | , | ||
0 | |||
) |
< Set when -finstrument-functions is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | MergeAllConstants | , |
1 | , | ||
1 | |||
) |
< Enable less precise MAD instructions to be generated.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | NoCommon | , |
1 | , | ||
0 | |||
) |
< Set when -fmerge-functions is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | NoExecStack | , |
1 | , | ||
0 | |||
) |
< Set when -fno-dwarf-directory-asm is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | EnableSegmentedStacks | , |
1 | , | ||
0 | |||
) |
< Set when -Wa,--fatal-warnings is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | NoImplicitFloat | , |
1 | , | ||
0 | |||
) |
< Set when -mno-global-merge is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | NoInline | , |
1 | , | ||
0 | |||
) |
< Assume FP arguments, results not +-Inf.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | NoZeroInitializedInBSS | , |
1 | , | ||
0 | |||
) |
< Assume FP arguments, results not NaN.
Method of Objective-C dispatch to use.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | ProfileInstrGenerate | , |
1 | , | ||
0 | |||
) |
< If -Os (==1) or -Oz (==2) is specified.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | DumpCoverageMapping | , |
1 | , | ||
0 | |||
) |
If -fpcc-struct-return or -freg-struct-return is specified.
< Generate coverage mapping regions to enable code coverage analysis.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | RelaxedAliasing | , |
1 | , | ||
0 | |||
) |
< Relax all machine code instructions.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | SaveTempLabels | , |
1 | , | ||
0 | |||
) |
< Whether or not to use struct-path TBAA.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | SanitizeMemoryTrackOrigins | , |
2 | , | ||
0 | |||
) |
< Map shadow memory at zero offset in AddressSanitizer.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | SanitizeUndefinedTrapOnError | , |
1 | , | ||
0 | |||
) |
< Enable sanitizer coverage instrumentation.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | SoftFloat | , |
1 | , | ||
0 | |||
) |
< Set when -fbuiltin is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | TimePasses | , |
1 | , | ||
0 | |||
) |
< Optimize based on strict enum definition.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | UnrollLoops | , |
1 | , | ||
0 | |||
) |
< Unused. For mirroring GCC optimization selection.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | UnsafeFPMath | , |
1 | , | ||
0 | |||
) |
< Control whether loops are rerolled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | VectorizeBB | , |
1 | , | ||
0 | |||
) |
< Emit unwind tables.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | VectorizeSLP | , |
1 | , | ||
0 | |||
) |
< Run loop vectorizer.
Attempt to use register sized accesses to bit-fields in structures, when possible.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | StackRealignment | , |
1 | , | ||
0 | |||
) |
< Control whether the module should be run through the LLVM Verifier.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::CODEGENOPT | ( | SanitizeRecover | , |
1 | , | ||
1 | |||
) |
The lower bound for a buffer to be considered for stack protection.
< Whether or not to use column information in debug info. The user specified number of registers to be used for integral arguments, or 0 if unspecified. The kind of generated debug info. Dwarf version. The kind of inlining to perform. The default TLS model to use.
clang::CodeGenOptions::VALUE_CODEGENOPT | ( | OptimizationLevel | , |
3 | , | ||
0 | |||
) |
< Set when -momit-leaf-frame-pointer is enabled.
Reimplemented from clang::CodeGenOptionsBase.
clang::CodeGenOptions::VALUE_CODEGENOPT | ( | StackAlignment | , |
32 | , | ||
0 | |||
) |
< Control whether to use .init_array or .ctors.
Reimplemented from clang::CodeGenOptionsBase.
std::vector<std::string> clang::CodeGenOptions::BackendOptions |
A list of command-line options to forward to the LLVM backend.
Definition at line 146 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::CodeModel |
The code model to use (-mcmodel).
Definition at line 98 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::CoverageFile |
The filename with path we use for coverage files. The extension will be replaced.
Definition at line 102 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
The version string to put into coverage files.
Definition at line 105 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::DebugCompilationDir |
The string to embed in debug information as the current working directory.
Definition at line 111 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::DebugPass |
Enable additional debugging information.
Definition at line 108 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::vector<std::string> clang::CodeGenOptions::DependentLibraries |
A list of dependent libraries.
Definition at line 149 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::DwarfDebugFlags |
The string to embed in the debug information for the compile unit, if non-empty.
Definition at line 115 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs(), and SetUpDiagnosticLog().
std::string clang::CodeGenOptions::FloatABI |
The ABI to use for passing floating point arguments.
Definition at line 118 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), and ParseCodeGenArgs().
std::string clang::CodeGenOptions::InstrProfileInput |
Name of the profile file to use as input for -fprofile-instr-use.
Definition at line 155 of file CodeGenOptions.h.
Referenced by clang::CodeGen::CodeGenModule::CodeGenModule(), and ParseCodeGenArgs().
std::string clang::CodeGenOptions::LimitFloatPrecision |
The float precision limit to use, if non-empty.
Definition at line 121 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::LinkBitcodeFile |
The name of the bitcode file to link before optzns.
Definition at line 124 of file CodeGenOptions.h.
Referenced by clang::CodeGenAction::CreateASTConsumer(), and ParseCodeGenArgs().
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 129 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
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 177 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
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 169 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
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 162 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::RelocationModel |
The name of the relocation model to use.
Definition at line 136 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::SampleProfileFile |
Name of the profile file to use with -fprofile-sample-use.
Definition at line 152 of file CodeGenOptions.h.
Referenced by addSampleProfileLoaderPass(), and ParseCodeGenArgs().
std::string clang::CodeGenOptions::SplitDwarfFile |
The name for the split debug info file that we'll break out. This is used in the backend for setting the name in the skeleton cu.
Definition at line 133 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
std::string clang::CodeGenOptions::ThreadModel |
The thread model to use.
Definition at line 139 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().
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 143 of file CodeGenOptions.h.
Referenced by ParseCodeGenArgs().