clang  7.0.0svn
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
clang::CodeGenOptions Class Reference

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

#include "clang/Frontend/CodeGenOptions.h"

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

Classes

struct  BitcodeFileToLink
 

Public Types

enum  InliningMethod { NormalInlining, OnlyHintInlining, OnlyAlwaysInlining }
 
enum  VectorLibrary { NoLibrary, Accelerate, SVML }
 
enum  ObjCDispatchMethodKind { Legacy = 0, NonLegacy = 1, Mixed = 2 }
 
enum  TLSModel { GeneralDynamicTLSModel, LocalDynamicTLSModel, InitialExecTLSModel, LocalExecTLSModel }
 
enum  ClangABI { ClangABI::Ver3_8, ClangABI::Ver4, ClangABI::Latest }
 Clang versions with different platform ABI conformance. More...
 
enum  StructReturnConventionKind { SRCK_Default, SRCK_OnStack, SRCK_InRegs }
 
enum  ProfileInstrKind { ProfileNone, ProfileClangInstr, ProfileIRInstr }
 
enum  EmbedBitcodeKind { Embed_Off, Embed_All, Embed_Bitcode, Embed_Marker }
 

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 hasProfileClangUse () const
 Check if Clang profile use is on. More...
 
bool hasProfileIRUse () const
 Check if IR level profile use is on. 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...
 
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::map< std::string, std::string > DebugPrefixMap
 
std::string FloatABI
 The ABI to use for passing floating point arguments. More...
 
std::string FPDenormalMode
 The floating-point denormal mode to use. More...
 
std::string LimitFloatPrecision
 The float precision limit to use, if non-empty. More...
 
std::vector< BitcodeFileToLinkLinkBitcodeFiles
 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 that we'll break out. 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 and -fprofile-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 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::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...
 

Detailed Description

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

Definition at line 46 of file CodeGenOptions.h.

Member Enumeration Documentation

◆ ClangABI

Clang versions with different platform ABI conformance.

Enumerator
Ver3_8 

Attempt to be ABI-compatible with code generated by Clang 3.8.x (SVN r257626).

This causes <1 x long long> to be passed in an integer register instead of an SSE register on x64_64.

Ver4 

Attempt to be ABI-compatible with code generated by Clang 4.0.x (SVN r291814).

This causes move operations to be ignored when determining whether a class type can be passed or returned directly.

Latest 

Conform to the underlying platform's C and C++ ABIs as closely as we can.

Definition at line 75 of file CodeGenOptions.h.

◆ EmbedBitcodeKind

Enumerator
Embed_Off 
Embed_All 
Embed_Bitcode 
Embed_Marker 

Definition at line 104 of file CodeGenOptions.h.

◆ InliningMethod

Enumerator
NormalInlining 
OnlyHintInlining 
OnlyAlwaysInlining 

Definition at line 48 of file CodeGenOptions.h.

◆ ObjCDispatchMethodKind

Enumerator
Legacy 
NonLegacy 
Mixed 

Definition at line 61 of file CodeGenOptions.h.

◆ ProfileInstrKind

Enumerator
ProfileNone 
ProfileClangInstr 
ProfileIRInstr 

Definition at line 97 of file CodeGenOptions.h.

◆ StructReturnConventionKind

Enumerator
SRCK_Default 
SRCK_OnStack 
SRCK_InRegs 

Definition at line 91 of file CodeGenOptions.h.

◆ TLSModel

Enumerator
GeneralDynamicTLSModel 
LocalDynamicTLSModel 
InitialExecTLSModel 
LocalExecTLSModel 

Definition at line 67 of file CodeGenOptions.h.

◆ VectorLibrary

Enumerator
NoLibrary 
Accelerate 
SVML 

Definition at line 54 of file CodeGenOptions.h.

Constructor & Destructor Documentation

◆ CodeGenOptions()

clang::CodeGenOptions::CodeGenOptions ( )

Definition at line 15 of file CodeGenOptions.cpp.

References CoverageVersion, memcpy(), and RelocationModel.

Member Function Documentation

◆ getNoBuiltinFuncs()

const std::vector<std::string>& clang::CodeGenOptions::getNoBuiltinFuncs ( ) const
inline

Definition at line 279 of file CodeGenOptions.h.

Referenced by createTLII().

◆ hasProfileClangInstr()

bool clang::CodeGenOptions::hasProfileClangInstr ( ) const
inline

Check if Clang profile instrumenation is on.

Definition at line 284 of file CodeGenOptions.h.

Referenced by clang::CodeGen::CodeGenFunction::incrementProfileCounter().

◆ hasProfileClangUse()

bool clang::CodeGenOptions::hasProfileClangUse ( ) const
inline

Check if Clang profile use is on.

Definition at line 294 of file CodeGenOptions.h.

◆ hasProfileIRInstr()

bool clang::CodeGenOptions::hasProfileIRInstr ( ) const
inline

Check if IR level profile instrumentation is on.

Definition at line 289 of file CodeGenOptions.h.

Referenced by mapToLevel().

◆ hasProfileIRUse()

bool clang::CodeGenOptions::hasProfileIRUse ( ) const
inline

Check if IR level profile use is on.

Definition at line 299 of file CodeGenOptions.h.

Referenced by mapToLevel().

◆ isNoBuiltinFunc()

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 24 of file CodeGenOptions.cpp.

Member Data Documentation

◆ CmdArgs

std::vector<uint8_t> clang::CodeGenOptions::CmdArgs

List of backend command-line options for -fembed-bitcode.

Definition at line 250 of file CodeGenOptions.h.

Referenced by clang::EmbedBitcode().

◆ CodeModel

std::string clang::CodeGenOptions::CodeModel

The code model to use (-mcmodel).

Definition at line 112 of file CodeGenOptions.h.

Referenced by getCodeModel().

◆ CoverageDataFile

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 117 of file CodeGenOptions.h.

◆ CoverageNotesFile

std::string clang::CodeGenOptions::CoverageNotesFile

The filename with path we use for coverage notes files.

Definition at line 120 of file CodeGenOptions.h.

◆ CoverageVersion

char clang::CodeGenOptions::CoverageVersion[4]

The version string to put into coverage files.

Definition at line 123 of file CodeGenOptions.h.

Referenced by CodeGenOptions().

◆ CudaGpuBinaryFileName

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 211 of file CodeGenOptions.h.

◆ DebugCompilationDir

std::string clang::CodeGenOptions::DebugCompilationDir

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

Definition at line 129 of file CodeGenOptions.h.

◆ DebugPass

std::string clang::CodeGenOptions::DebugPass

Enable additional debugging information.

Definition at line 126 of file CodeGenOptions.h.

Referenced by setCommandLineOpts().

◆ DebugPrefixMap

std::map<std::string, std::string> clang::CodeGenOptions::DebugPrefixMap

Definition at line 135 of file CodeGenOptions.h.

Referenced by clang::CodeGen::CGDebugInfo::CGDebugInfo().

◆ DependentLibraries

std::vector<std::string> clang::CodeGenOptions::DependentLibraries

A list of dependent libraries.

Definition at line 182 of file CodeGenOptions.h.

◆ DwarfDebugFlags

std::string clang::CodeGenOptions::DwarfDebugFlags

The string to embed in the debug information for the compile unit, if non-empty.

Definition at line 133 of file CodeGenOptions.h.

Referenced by SetUpDiagnosticLog().

◆ FloatABI

std::string clang::CodeGenOptions::FloatABI

The ABI to use for passing floating point arguments.

Definition at line 138 of file CodeGenOptions.h.

◆ FPDenormalMode

std::string clang::CodeGenOptions::FPDenormalMode

The floating-point denormal mode to use.

Definition at line 141 of file CodeGenOptions.h.

◆ InstrProfileOutput

std::string clang::CodeGenOptions::InstrProfileOutput

Name of the profile file to use as output for -fprofile-instr-generate and -fprofile-generate.

Definition at line 189 of file CodeGenOptions.h.

Referenced by mapToLevel().

◆ LimitFloatPrecision

std::string clang::CodeGenOptions::LimitFloatPrecision

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

Definition at line 144 of file CodeGenOptions.h.

Referenced by setCommandLineOpts().

◆ LinkBitcodeFiles

std::vector<BitcodeFileToLink> clang::CodeGenOptions::LinkBitcodeFiles

The files specified here are linked in to the module before optimizations.

Definition at line 160 of file CodeGenOptions.h.

Referenced by clang::CodeGenAction::CreateASTConsumer().

◆ LinkerOptions

std::vector<std::string> clang::CodeGenOptions::LinkerOptions

A list of linker options to embed in the object file.

Definition at line 185 of file CodeGenOptions.h.

◆ MainFileName

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 165 of file CodeGenOptions.h.

◆ NoBuiltinFuncs

std::vector<std::string> clang::CodeGenOptions::NoBuiltinFuncs

A list of all -fno-builtin-* function names (e.g., memset).

Definition at line 253 of file CodeGenOptions.h.

◆ OptimizationRemarkAnalysisPattern

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 237 of file CodeGenOptions.h.

◆ OptimizationRemarkMissedPattern

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 229 of file CodeGenOptions.h.

◆ OptimizationRemarkPattern

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 222 of file CodeGenOptions.h.

◆ OptRecordFile

std::string clang::CodeGenOptions::OptRecordFile

The name of the file to which the backend should save YAML optimization records.

Definition at line 215 of file CodeGenOptions.h.

◆ PreferVectorWidth

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 260 of file CodeGenOptions.h.

◆ ProfileInstrumentUsePath

std::string clang::CodeGenOptions::ProfileInstrumentUsePath

Name of the profile file to use as input for -fprofile-instr-use.

Definition at line 195 of file CodeGenOptions.h.

Referenced by mapToLevel().

◆ Reciprocals

std::vector<std::string> clang::CodeGenOptions::Reciprocals

Definition at line 255 of file CodeGenOptions.h.

◆ RelocationModel

llvm::Reloc::Model clang::CodeGenOptions::RelocationModel

The name of the relocation model to use.

Definition at line 172 of file CodeGenOptions.h.

Referenced by CodeGenOptions(), setCommandLineOpts(), and shouldAssumeDSOLocal().

◆ RewriteMapFiles

std::vector<std::string> clang::CodeGenOptions::RewriteMapFiles

Set of files defining the rules for the symbol rewriting.

Definition at line 240 of file CodeGenOptions.h.

Referenced by addSymbolRewriterPass().

◆ SampleProfileFile

std::string clang::CodeGenOptions::SampleProfileFile

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

Definition at line 192 of file CodeGenOptions.h.

Referenced by mapToLevel().

◆ SanitizeRecover

SanitizerSet clang::CodeGenOptions::SanitizeRecover

Set of sanitizer checks that are non-fatal (i.e.

execution should be continued when possible).

Definition at line 244 of file CodeGenOptions.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitCheck().

◆ SanitizeTrap

SanitizerSet clang::CodeGenOptions::SanitizeTrap

Set of sanitizer checks that trap rather than diagnose.

Definition at line 247 of file CodeGenOptions.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), and clang::CodeGen::CodeGenFunction::EmitCheck().

◆ SaveTempsFilePrefix

std::string clang::CodeGenOptions::SaveTempsFilePrefix

Prefix to use for -save-temps output.

Definition at line 207 of file CodeGenOptions.h.

◆ SplitDwarfFile

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 169 of file CodeGenOptions.h.

◆ ThinLinkBitcodeFile

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 204 of file CodeGenOptions.h.

◆ ThinLTOIndexFile

std::string clang::CodeGenOptions::ThinLTOIndexFile

Name of the function summary index file to use for ThinLTO function importing.

Definition at line 199 of file CodeGenOptions.h.

◆ ThreadModel

std::string clang::CodeGenOptions::ThreadModel

The thread model to use.

Definition at line 175 of file CodeGenOptions.h.

◆ TrapFuncName

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 179 of file CodeGenOptions.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitTrapCall().

◆ XRayInstrumentationBundle

XRayInstrSet clang::CodeGenOptions::XRayInstrumentationBundle

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