clang API Documentation

Public Types | Public Member Functions | Public Attributes
clang::CodeGenOptions Class Reference

#include <CodeGenOptions.h>

Inheritance diagram for clang::CodeGenOptions:
Inheritance graph
[legend]
Collaboration diagram for clang::CodeGenOptions:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

CodeGenOptions - Track various options which control how the code is optimized and passed to the backend.

Definition at line 40 of file CodeGenOptions.h.


Member Enumeration Documentation

Enumerator:
NoDebugInfo 
LocTrackingOnly 

Don't generate debug info.

DebugLineTablesOnly 

Emit location information but do not generate debug info in the output. This is useful in cases where the backend wants to track source locations for instructions without actually emitting debug info for them (e.g., when -Rpass is used).

LimitedDebugInfo 

Emit only debug info necessary for generating line number tables (-gline-tables-only).

FullDebugInfo 

Generate complete debug info.

Limit generated debug info to reduce size (-fno-standalone-debug). This emits forward decls for types that could be replaced with forward decls in the source code. For dynamic C++ classes type info is only emitted int the module that contains the classe's vtable.

Definition at line 54 of file CodeGenOptions.h.

Enumerator:
FPC_Off 
FPC_On 
FPC_Fast 

Definition at line 85 of file CodeGenOptions.h.

Enumerator:
NoInlining 
NormalInlining 
OnlyAlwaysInlining 

Definition at line 42 of file CodeGenOptions.h.

Enumerator:
Legacy 
NonLegacy 
Mixed 

Definition at line 48 of file CodeGenOptions.h.

Enumerator:
SRCK_Default 
SRCK_OnStack 
SRCK_InRegs 

Definition at line 91 of file CodeGenOptions.h.

Enumerator:
GeneralDynamicTLSModel 
LocalDynamicTLSModel 
InitialExecTLSModel 
LocalExecTLSModel 

Definition at line 78 of file CodeGenOptions.h.


Member Function Documentation

clang::CodeGenOptions::CODEGENOPT ( DisableIntegratedAS  ,
,
 
)

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( Autolink  ,
,
 
)

< -Wa,-compress-debug-sections

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( ObjCAutoRefCountExceptions  ,
,
 
)

< -dA, -fverbose-asm.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( CoverageNoFunctionNamesInData  ,
,
 
)

< Whether we need a second checksum for functions in GCNO files.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( CXAAtExit  ,
,
 
)

< Set when compiling for CUDA device.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( DataSections  ,
,
 
)

< Emit complete ctors/dtors as linker aliases to base ctors when possible.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( DisableFree  ,
,
 
)

< Set when -fomit-frame-pointer is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( DisableLLVMOpts  ,
,
 
)

< Don't run the GCov pass, for testing.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( DisableTailCalls  ,
,
 
)

< Set when -mno-red-zone is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( EmitGcovArcs  ,
,
 
)

< 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  ,
,
 
)

< Emit coverage "notes" files, aka GCNO.

FP_CONTRACT mode (on/off/fast).

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( FunctionSections  ,
,
 
)

< Issue errors if C++ guard variables are required.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( InstrumentForProfiling  ,
,
 
)

< Set when -finstrument-functions is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( MergeAllConstants  ,
,
 
)

< Enable less precise MAD instructions to be generated.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( NoCommon  ,
,
 
)

< Set when -fmerge-functions is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( NoExecStack  ,
,
 
)

< Set when -fno-dwarf-directory-asm is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( EnableSegmentedStacks  ,
,
 
)

< Set when -Wa,--fatal-warnings is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( NoImplicitFloat  ,
,
 
)

< Set when -mno-global-merge is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( NoInline  ,
,
 
)

< Assume FP arguments, results not +-Inf.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( NoZeroInitializedInBSS  ,
,
 
)

< Assume FP arguments, results not NaN.

Method of Objective-C dispatch to use.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( ProfileInstrGenerate  ,
,
 
)

< If -Os (==1) or -Oz (==2) is specified.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( DumpCoverageMapping  ,
,
 
)

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  ,
,
 
)

< Relax all machine code instructions.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( SaveTempLabels  ,
,
 
)

< Whether or not to use struct-path TBAA.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( SanitizeMemoryTrackOrigins  ,
,
 
)

< Map shadow memory at zero offset in AddressSanitizer.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( SanitizeUndefinedTrapOnError  ,
,
 
)

< Enable sanitizer coverage instrumentation.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( SoftFloat  ,
,
 
)

< Set when -fbuiltin is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( TimePasses  ,
,
 
)

< Optimize based on strict enum definition.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( UnrollLoops  ,
,
 
)

< Unused. For mirroring GCC optimization selection.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( UnsafeFPMath  ,
,
 
)

< Control whether loops are rerolled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( VectorizeBB  ,
,
 
)

< Emit unwind tables.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( VectorizeSLP  ,
,
 
)

< Run loop vectorizer.

Attempt to use register sized accesses to bit-fields in structures, when possible.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( StackRealignment  ,
,
 
)

< Control whether the module should be run through the LLVM Verifier.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::CODEGENOPT ( SanitizeRecover  ,
,
 
)

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  ,
,
 
)

< Set when -momit-leaf-frame-pointer is enabled.

Reimplemented from clang::CodeGenOptionsBase.

clang::CodeGenOptions::VALUE_CODEGENOPT ( StackAlignment  ,
32  ,
 
)

< Control whether to use .init_array or .ctors.

Reimplemented from clang::CodeGenOptionsBase.


Member Data Documentation

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().

The code model to use (-mcmodel).

Definition at line 98 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

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().

The string to embed in debug information as the current working directory.

Definition at line 111 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

Enable additional debugging information.

Definition at line 108 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

A list of dependent libraries.

Definition at line 149 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

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().

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().

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().

The float precision limit to use, if non-empty.

Definition at line 121 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

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().

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().

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().

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().

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().

The name of the relocation model to use.

Definition at line 136 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

Name of the profile file to use with -fprofile-sample-use.

Definition at line 152 of file CodeGenOptions.h.

Referenced by addSampleProfileLoaderPass(), and ParseCodeGenArgs().

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().

The thread model to use.

Definition at line 139 of file CodeGenOptions.h.

Referenced by ParseCodeGenArgs().

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().


The documentation for this class was generated from the following files: