OLD | NEW |
1 //===- subzero/src/IceClFlags.h - Cl Flags for translation ------*- C++ -*-===// | 1 //===- subzero/src/IceClFlags.h - Cl Flags for translation ------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file declares command line flags controlling translation. | 10 // This file declares command line flags controlling translation. |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 #ifndef SUBZERO_SRC_ICECLFLAGS_H | 14 #ifndef SUBZERO_SRC_ICECLFLAGS_H |
15 #define SUBZERO_SRC_ICECLFLAGS_H | 15 #define SUBZERO_SRC_ICECLFLAGS_H |
16 | 16 |
17 #include "IceTypes.def" | 17 #include "IceTypes.def" |
18 | 18 |
19 namespace Ice { | 19 namespace Ice { |
20 | 20 |
21 class ClFlags { | 21 class ClFlags { |
| 22 ClFlags(const ClFlags &) = delete; |
| 23 ClFlags &operator=(const ClFlags &) = delete; |
| 24 |
22 public: | 25 public: |
23 ClFlags() | 26 ClFlags() |
24 : DisableInternal(false), SubzeroTimingEnabled(false), | 27 : // bool fields. |
25 DisableTranslation(false), FunctionSections(false), DataSections(false), | 28 AllowErrorRecovery(false), |
26 UseELFWriter(false), UseIntegratedAssembler(false), | 29 AllowUninitializedGlobals(false), DataSections(false), |
27 UseSandboxing(false), PhiEdgeSplit(false), DecorateAsm(false), | 30 DecorateAsm(false), DisableInternal(false), DisableIRGeneration(false), |
28 DumpStats(false), AllowUninitializedGlobals(false), | 31 DisableTranslation(false), DumpStats(false), FunctionSections(false), |
29 TimeEachFunction(false), DisableIRGeneration(false), | 32 GenerateUnitTestMessages(false), PhiEdgeSplit(false), |
30 AllowErrorRecovery(false), StubConstantCalls(false), | 33 StubConstantCalls(false), SubzeroTimingEnabled(false), |
31 GenerateUnitTestMessages(false), NumTranslationThreads(0), | 34 TimeEachFunction(false), UseELFWriter(false), |
32 DefaultGlobalPrefix(""), DefaultFunctionPrefix(""), TimingFocusOn(""), | 35 UseIntegratedAssembler(false), UseSandboxing(false), |
33 VerboseFocusOn(""), TranslateOnly("") {} | 36 // IceString fields. |
| 37 DefaultFunctionPrefix(""), DefaultGlobalPrefix(""), TimingFocusOn(""), |
| 38 TranslateOnly(""), VerboseFocusOn(""), |
| 39 // size_t fields. |
| 40 NumTranslationThreads(0) {} |
| 41 |
| 42 // bool accessors. |
| 43 |
| 44 bool getAllowErrorRecovery() const { return AllowErrorRecovery; } |
| 45 void setAllowErrorRecovery(bool NewValue) { AllowErrorRecovery = NewValue; } |
| 46 |
| 47 bool getAllowUninitializedGlobals() const { |
| 48 return AllowUninitializedGlobals; |
| 49 } |
| 50 void setAllowUninitializedGlobals(bool NewValue) { |
| 51 AllowUninitializedGlobals = NewValue; |
| 52 } |
| 53 |
| 54 bool getDataSections() const { return DataSections; } |
| 55 void setDataSections(bool NewValue) { DataSections = NewValue; } |
| 56 |
| 57 bool getDecorateAsm() const { return DecorateAsm; } |
| 58 void setDecorateAsm(bool NewValue) { DecorateAsm = NewValue; } |
| 59 |
| 60 bool getDisableInternal() const { return DisableInternal; } |
| 61 void setDisableInternal(bool NewValue) { DisableInternal = NewValue; } |
| 62 |
| 63 bool getDisableIRGeneration() const { |
| 64 return ALLOW_DISABLE_IR_GEN && DisableIRGeneration; |
| 65 } |
| 66 void setDisableIRGeneration(bool NewValue) { DisableIRGeneration = NewValue; } |
| 67 |
| 68 bool getDisableTranslation() const { return DisableTranslation; } |
| 69 void setDisableTranslation(bool NewValue) { DisableTranslation = NewValue; } |
| 70 |
| 71 bool getDumpStats() const { return ALLOW_DUMP && DumpStats; } |
| 72 void setDumpStats(bool NewValue) { DumpStats = NewValue; } |
| 73 |
| 74 bool getFunctionSections() const { return FunctionSections; } |
| 75 void setFunctionSections(bool NewValue) { FunctionSections = NewValue; } |
| 76 |
| 77 bool getGenerateUnitTestMessages() const { |
| 78 // Note: If dump routines have been turned off, the error messages |
| 79 // will not be readable. Hence, turn off. |
| 80 return !ALLOW_DUMP || GenerateUnitTestMessages; |
| 81 } |
| 82 void setGenerateUnitTestMessages(bool NewValue) { |
| 83 GenerateUnitTestMessages = NewValue; |
| 84 } |
| 85 |
| 86 bool getPhiEdgeSplit() const { return PhiEdgeSplit; } |
| 87 void setPhiEdgeSplit(bool NewValue) { PhiEdgeSplit = NewValue; } |
| 88 |
| 89 bool getStubConstantCalls() const { |
| 90 return !ALLOW_MINIMAL_BUILD && StubConstantCalls; |
| 91 } |
| 92 void setStubConstantCalls(bool NewValue) { StubConstantCalls = NewValue; } |
| 93 |
| 94 bool getSubzeroTimingEnabled() const { return SubzeroTimingEnabled; } |
| 95 void setSubzeroTimingEnabled(bool NewValue) { |
| 96 SubzeroTimingEnabled = NewValue; |
| 97 } |
| 98 |
| 99 bool getTimeEachFunction() const { return ALLOW_DUMP && TimeEachFunction; } |
| 100 void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; } |
| 101 |
| 102 bool getUseELFWriter() const { return UseELFWriter; } |
| 103 void setUseELFWriter(bool NewValue) { UseELFWriter = NewValue; } |
| 104 |
| 105 bool getUseIntegratedAssembler() const { return UseIntegratedAssembler; } |
| 106 void setUseIntegratedAssembler(bool NewValue) { |
| 107 UseIntegratedAssembler = NewValue; |
| 108 } |
| 109 |
| 110 bool getUseSandboxing() const { return UseSandboxing; } |
| 111 void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; } |
| 112 |
| 113 // IceString accessors. |
| 114 |
| 115 const IceString &getDefaultFunctionPrefix() const { |
| 116 return DefaultFunctionPrefix; |
| 117 } |
| 118 void setDefaultFunctionPrefix(const IceString &NewValue) { |
| 119 DefaultFunctionPrefix = NewValue; |
| 120 } |
| 121 |
| 122 const IceString &getDefaultGlobalPrefix() const { |
| 123 return DefaultGlobalPrefix; |
| 124 } |
| 125 void setDefaultGlobalPrefix(const IceString &NewValue) { |
| 126 DefaultGlobalPrefix = NewValue; |
| 127 } |
| 128 |
| 129 const IceString &getTimingFocusOn() const { return TimingFocusOn; } |
| 130 void setTimingFocusOn(const IceString &NewValue) { TimingFocusOn = NewValue; } |
| 131 |
| 132 const IceString &getTranslateOnly() const { return TranslateOnly; } |
| 133 void setTranslateOnly(const IceString &NewValue) { TranslateOnly = NewValue; } |
| 134 |
| 135 const IceString &getVerboseFocusOn() const { return VerboseFocusOn; } |
| 136 void setVerboseFocusOn(const IceString &NewValue) { |
| 137 VerboseFocusOn = NewValue; |
| 138 } |
| 139 |
| 140 // size_t accessors. |
| 141 |
| 142 size_t getNumTranslationThreads() const { return NumTranslationThreads; } |
| 143 void setNumTranslationThreads(size_t NewValue) { |
| 144 NumTranslationThreads = NewValue; |
| 145 } |
| 146 |
| 147 private: |
| 148 bool AllowErrorRecovery; |
| 149 bool AllowUninitializedGlobals; |
| 150 bool DataSections; |
| 151 bool DecorateAsm; |
34 bool DisableInternal; | 152 bool DisableInternal; |
| 153 bool DisableIRGeneration; |
| 154 bool DisableTranslation; |
| 155 bool DumpStats; |
| 156 bool FunctionSections; |
| 157 bool GenerateUnitTestMessages; |
| 158 bool PhiEdgeSplit; |
| 159 bool StubConstantCalls; |
35 bool SubzeroTimingEnabled; | 160 bool SubzeroTimingEnabled; |
36 bool DisableTranslation; | 161 bool TimeEachFunction; |
37 bool FunctionSections; | |
38 bool DataSections; | |
39 bool UseELFWriter; | 162 bool UseELFWriter; |
40 bool UseIntegratedAssembler; | 163 bool UseIntegratedAssembler; |
41 bool UseSandboxing; | 164 bool UseSandboxing; |
42 bool PhiEdgeSplit; | 165 |
43 bool DecorateAsm; | 166 IceString DefaultFunctionPrefix; |
44 bool DumpStats; | 167 IceString DefaultGlobalPrefix; |
45 bool AllowUninitializedGlobals; | 168 IceString TimingFocusOn; |
46 bool TimeEachFunction; | 169 IceString TranslateOnly; |
47 bool DisableIRGeneration; | 170 IceString VerboseFocusOn; |
48 bool AllowErrorRecovery; | 171 |
49 bool StubConstantCalls; | |
50 bool GenerateUnitTestMessages; | |
51 size_t NumTranslationThreads; // 0 means completely sequential | 172 size_t NumTranslationThreads; // 0 means completely sequential |
52 IceString DefaultGlobalPrefix; | |
53 IceString DefaultFunctionPrefix; | |
54 IceString TimingFocusOn; | |
55 IceString VerboseFocusOn; | |
56 IceString TranslateOnly; | |
57 }; | 173 }; |
58 | 174 |
59 } // end of namespace Ice | 175 } // end of namespace Ice |
60 | 176 |
61 #endif // SUBZERO_SRC_ICECLFLAGS_H | 177 #endif // SUBZERO_SRC_ICECLFLAGS_H |
OLD | NEW |