diff options
Diffstat (limited to 'include/clang/Frontend/CodeGenOptions.h')
-rw-r--r-- | include/clang/Frontend/CodeGenOptions.h | 180 |
1 files changed, 104 insertions, 76 deletions
diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index e844f88..3e34093 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -35,84 +35,101 @@ public: Mixed = 2 }; - unsigned AsmVerbose : 1; /// -dA, -fverbose-asm. - unsigned ObjCAutoRefCountExceptions : 1; /// Whether ARC should be EH-safe. - unsigned CUDAIsDevice : 1; /// Set when compiling for CUDA device. - unsigned CXAAtExit : 1; /// Use __cxa_atexit for calling destructors. - unsigned CXXCtorDtorAliases: 1; /// Emit complete ctors/dtors as linker - /// aliases to base ctors when possible. - unsigned DataSections : 1; /// Set when -fdata-sections is enabled - unsigned DebugInfo : 1; /// Should generate debug info (-g). - unsigned LimitDebugInfo : 1; /// Limit generated debug info to reduce size. - unsigned DisableFPElim : 1; /// Set when -fomit-frame-pointer is enabled. - unsigned DisableLLVMOpts : 1; /// Don't run any optimizations, for use in - /// getting .bc files that correspond to the - /// internal state before optimizations are - /// done. - unsigned DisableRedZone : 1; /// Set when -mno-red-zone is enabled. - unsigned DisableTailCalls : 1; /// Do not emit tail calls. - unsigned EmitDeclMetadata : 1; /// Emit special metadata indicating what - /// Decl* various IR entities came from. Only - /// useful when running CodeGen as a - /// subroutine. - unsigned EmitGcovArcs : 1; /// Emit coverage data files, aka. GCDA. - unsigned EmitGcovNotes : 1; /// Emit coverage "notes" files, aka GCNO. - unsigned ForbidGuardVariables : 1; /// Issue errors if C++ guard variables - /// are required - unsigned FunctionSections : 1; /// Set when -ffunction-sections is enabled - unsigned HiddenWeakTemplateVTables : 1; /// Emit weak vtables and RTTI for - /// template classes with hidden visibility - unsigned HiddenWeakVTables : 1; /// Emit weak vtables, RTTI, and thunks with - /// hidden visibility. - unsigned InstrumentFunctions : 1; /// Set when -finstrument-functions is - /// enabled. - unsigned InstrumentForProfiling : 1; /// Set when -pg is enabled - unsigned LessPreciseFPMAD : 1; /// Enable less precise MAD instructions to be - /// generated. - unsigned MergeAllConstants : 1; /// Merge identical constants. - unsigned NoCommon : 1; /// Set when -fno-common or C++ is enabled. - unsigned NoDwarf2CFIAsm : 1; /// Set when -fno-dwarf2-cfi-asm is enabled. - unsigned NoDwarfDirectoryAsm : 1; /// Set when -fno-dwarf-directory-asm is - /// enabled. - unsigned NoExecStack : 1; /// Set when -Wa,--noexecstack is enabled. - unsigned NoGlobalMerge : 1; /// Set when -mno-global-merge is enabled. - unsigned NoImplicitFloat : 1; /// Set when -mno-implicit-float is enabled. - unsigned NoInfsFPMath : 1; /// Assume FP arguments, results not +-Inf. - unsigned NoInline : 1; /// Set when -fno-inline is enabled. Disables - /// use of the inline keyword. - unsigned NoNaNsFPMath : 1; /// Assume FP arguments, results not NaN. - unsigned NoZeroInitializedInBSS : 1; /// -fno-zero-initialized-in-bss - unsigned ObjCDispatchMethod : 2; /// Method of Objective-C dispatch to use. - unsigned ObjCRuntimeHasARC : 1; /// The target runtime supports ARC natively - unsigned ObjCRuntimeHasTerminate : 1; /// The ObjC runtime has objc_terminate - unsigned OmitLeafFramePointer : 1; /// Set when -momit-leaf-frame-pointer is - /// enabled. - unsigned OptimizationLevel : 3; /// The -O[0-4] option specified. - unsigned OptimizeSize : 2; /// If -Os (==1) or -Oz (==2) is specified. - unsigned RelaxAll : 1; /// Relax all machine code instructions. - unsigned RelaxedAliasing : 1; /// Set when -fno-strict-aliasing is enabled. - unsigned SaveTempLabels : 1; /// Save temporary labels. - unsigned SimplifyLibCalls : 1; /// Set when -fbuiltin is enabled. - unsigned SoftFloat : 1; /// -soft-float. - unsigned StrictEnums : 1; /// Optimize based on strict enum definition. - unsigned TimePasses : 1; /// Set when -ftime-report is enabled. - unsigned UnitAtATime : 1; /// Unused. For mirroring GCC optimization - /// selection. - unsigned UnrollLoops : 1; /// Control whether loops are unrolled. - unsigned UnsafeFPMath : 1; /// Allow unsafe floating point optzns. - unsigned UnwindTables : 1; /// Emit unwind tables. + enum DebugInfoKind { + NoDebugInfo, // Don't generate debug info. + DebugLineTablesOnly, // Emit only debug info necessary for generating + // line number tables (-gline-tables-only). + LimitedDebugInfo, // Limit generated debug info to reduce size + // (-flimit-debug-info). + FullDebugInfo // Generate complete debug info. + }; + + enum TLSModel { + GeneralDynamicTLSModel, + LocalDynamicTLSModel, + InitialExecTLSModel, + LocalExecTLSModel + }; + + unsigned AsmVerbose : 1; ///< -dA, -fverbose-asm. + unsigned ObjCAutoRefCountExceptions : 1; ///< Whether ARC should be EH-safe. + unsigned CUDAIsDevice : 1; ///< Set when compiling for CUDA device. + unsigned CXAAtExit : 1; ///< Use __cxa_atexit for calling destructors. + unsigned CXXCtorDtorAliases: 1; ///< Emit complete ctors/dtors as linker + ///< aliases to base ctors when possible. + unsigned DataSections : 1; ///< Set when -fdata-sections is enabled. + unsigned DisableFPElim : 1; ///< Set when -fomit-frame-pointer is enabled. + unsigned DisableLLVMOpts : 1; ///< Don't run any optimizations, for use in + ///< getting .bc files that correspond to the + ///< internal state before optimizations are + ///< done. + unsigned DisableRedZone : 1; ///< Set when -mno-red-zone is enabled. + unsigned DisableTailCalls : 1; ///< Do not emit tail calls. + unsigned EmitDeclMetadata : 1; ///< Emit special metadata indicating what + ///< Decl* various IR entities came from. Only + ///< useful when running CodeGen as a + ///< subroutine. + unsigned EmitGcovArcs : 1; ///< Emit coverage data files, aka. GCDA. + unsigned EmitGcovNotes : 1; ///< Emit coverage "notes" files, aka GCNO. + unsigned EmitOpenCLArgMetadata : 1; ///< Emit OpenCL kernel arg metadata. + unsigned EmitMicrosoftInlineAsm : 1; ///< Enable emission of MS-style inline + ///< assembly. + unsigned ForbidGuardVariables : 1; ///< Issue errors if C++ guard variables + ///< are required. + unsigned FunctionSections : 1; ///< Set when -ffunction-sections is enabled. + unsigned HiddenWeakTemplateVTables : 1; ///< Emit weak vtables and RTTI for + ///< template classes with hidden visibility + unsigned HiddenWeakVTables : 1; ///< Emit weak vtables, RTTI, and thunks with + ///< hidden visibility. + unsigned InstrumentFunctions : 1; ///< Set when -finstrument-functions is + ///< enabled. + unsigned InstrumentForProfiling : 1; ///< Set when -pg is enabled. + unsigned LessPreciseFPMAD : 1; ///< Enable less precise MAD instructions to + ///< be generated. + unsigned MergeAllConstants : 1; ///< Merge identical constants. + unsigned NoCommon : 1; ///< Set when -fno-common or C++ is enabled. + unsigned NoDwarf2CFIAsm : 1; ///< Set when -fno-dwarf2-cfi-asm is enabled. + unsigned NoDwarfDirectoryAsm : 1; ///< Set when -fno-dwarf-directory-asm is + ///< enabled. + unsigned NoExecStack : 1; ///< Set when -Wa,--noexecstack is enabled. + unsigned NoGlobalMerge : 1; ///< Set when -mno-global-merge is enabled. + unsigned NoImplicitFloat : 1; ///< Set when -mno-implicit-float is enabled. + unsigned NoInfsFPMath : 1; ///< Assume FP arguments, results not +-Inf. + unsigned NoInline : 1; ///< Set when -fno-inline is enabled. Disables + ///< use of the inline keyword. + unsigned NoNaNsFPMath : 1; ///< Assume FP arguments, results not NaN. + unsigned NoZeroInitializedInBSS : 1; ///< -fno-zero-initialized-in-bss. + unsigned ObjCDispatchMethod : 2; ///< Method of Objective-C dispatch to use. + unsigned OmitLeafFramePointer : 1; ///< Set when -momit-leaf-frame-pointer is + ///< enabled. + unsigned OptimizationLevel : 3; ///< The -O[0-4] option specified. + unsigned OptimizeSize : 2; ///< If -Os (==1) or -Oz (==2) is specified. + unsigned RelaxAll : 1; ///< Relax all machine code instructions. + unsigned RelaxedAliasing : 1; ///< Set when -fno-strict-aliasing is enabled. + unsigned SaveTempLabels : 1; ///< Save temporary labels. + unsigned SimplifyLibCalls : 1; ///< Set when -fbuiltin is enabled. + unsigned SoftFloat : 1; ///< -soft-float. + unsigned StrictEnums : 1; ///< Optimize based on strict enum definition. + unsigned TimePasses : 1; ///< Set when -ftime-report is enabled. + unsigned UnitAtATime : 1; ///< Unused. For mirroring GCC optimization + ///< selection. + unsigned UnrollLoops : 1; ///< Control whether loops are unrolled. + unsigned UnsafeFPMath : 1; ///< Allow unsafe floating point optzns. + unsigned UnwindTables : 1; ///< Emit unwind tables. /// Attempt to use register sized accesses to bit-fields in structures, when /// possible. unsigned UseRegisterSizedBitfieldAccess : 1; - unsigned VerifyModule : 1; /// Control whether the module should be run - /// through the LLVM Verifier. + unsigned VerifyModule : 1; ///< Control whether the module should be run + ///< through the LLVM Verifier. - unsigned StackRealignment : 1; /// Control whether to permit stack - /// realignment. - unsigned StackAlignment; /// Overrides default stack alignment, - /// if not 0. + unsigned StackRealignment : 1; ///< Control whether to permit stack + ///< realignment. + unsigned UseInitArray : 1; ///< Control whether to use .init_array or + ///< .ctors. + unsigned StackAlignment; ///< Overrides default stack alignment, + ///< if not 0. /// The code model to use (-mcmodel). std::string CodeModel; @@ -127,6 +144,9 @@ public: /// The string to embed in debug information as the current working directory. std::string DebugCompilationDir; + /// The kind of generated debug info. + DebugInfoKind DebugInfo; + /// The string to embed in the debug information for the compile unit, if /// non-empty. std::string DwarfDebugFlags; @@ -162,6 +182,12 @@ public: /// or 0 if unspecified. unsigned NumRegisterParameters; + /// The run-time penalty for bounds checking, or 0 to disable. + unsigned char BoundsChecking; + + /// The default TLS model to use. + TLSModel DefaultTLSModel; + public: CodeGenOptions() { AsmVerbose = 0; @@ -169,8 +195,6 @@ public: CXAAtExit = 1; CXXCtorDtorAliases = 0; DataSections = 0; - DebugInfo = 0; - LimitDebugInfo = 0; DisableFPElim = 0; DisableLLVMOpts = 0; DisableRedZone = 0; @@ -178,6 +202,8 @@ public: EmitDeclMetadata = 0; EmitGcovArcs = 0; EmitGcovNotes = 0; + EmitOpenCLArgMetadata = 0; + EmitMicrosoftInlineAsm = 0; ForbidGuardVariables = 0; FunctionSections = 0; HiddenWeakTemplateVTables = 0; @@ -196,8 +222,6 @@ public: NumRegisterParameters = 0; ObjCAutoRefCountExceptions = 0; ObjCDispatchMethod = Legacy; - ObjCRuntimeHasARC = 0; - ObjCRuntimeHasTerminate = 0; OmitLeafFramePointer = 0; OptimizationLevel = 0; OptimizeSize = 0; @@ -216,9 +240,13 @@ public: VerifyModule = 1; StackRealignment = 0; StackAlignment = 0; + BoundsChecking = 0; + UseInitArray = 0; + DebugInfo = NoDebugInfo; Inlining = NoInlining; RelocationModel = "pic"; + DefaultTLSModel = GeneralDynamicTLSModel; } ObjCDispatchMethodKind getObjCDispatchMethod() const { |