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), |
35 UseIntegratedAssembler(false), UseSandboxing(false), | |
36 // IceString fields. | |
32 DefaultGlobalPrefix(""), DefaultFunctionPrefix(""), TimingFocusOn(""), | 37 DefaultGlobalPrefix(""), DefaultFunctionPrefix(""), TimingFocusOn(""), |
33 VerboseFocusOn(""), TranslateOnly("") {} | 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 { | |
72 return ALLOW_DUMP && DumpStats; | |
73 } | |
74 void setDumpStats(bool NewValue) { DumpStats = NewValue; } | |
75 | |
76 bool getFunctionSections() const { return FunctionSections; } | |
77 void setFunctionSections(bool NewValue) { FunctionSections = NewValue; } | |
78 | |
79 bool getGenerateUnitTestMessages() const { | |
80 // Note: If dump routines have been turned off, the error messages | |
81 // will not be readable. Hence, turn off. | |
82 return !ALLOW_DUMP || GenerateUnitTestMessages; | |
83 } | |
84 void setGenerateUnitTestMessages(bool NewValue) { | |
85 GenerateUnitTestMessages = NewValue; | |
86 } | |
87 | |
88 bool getPhiEdgeSplit() const { return PhiEdgeSplit; } | |
89 void setPhiEdgeSplit(bool NewValue) { PhiEdgeSplit = NewValue; } | |
90 | |
91 bool getStubConstantCalls() const { | |
92 return !ALLOW_MINIMAL_BUILD && StubConstantCalls; | |
93 } | |
94 void setStubConstantCalls(bool NewValue) { StubConstantCalls = NewValue; } | |
95 | |
96 bool getSubzeroTimingEnabled() const { return SubzeroTimingEnabled; } | |
97 void setSubzeroTimingEnabled(bool NewValue) { | |
98 SubzeroTimingEnabled = NewValue; | |
99 } | |
100 | |
101 bool getTimeEachFunction() const { | |
102 return ALLOW_DUMP && TimeEachFunction; | |
103 } | |
104 void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; } | |
105 | |
106 bool getUseELFWriter() const { return UseELFWriter; } | |
107 void setUseELFWriter(bool NewValue) { UseELFWriter = NewValue; } | |
108 | |
109 bool getUseIntegratedAssembler() const { return UseIntegratedAssembler; } | |
110 void setUseIntegratedAssembler(bool NewValue) { | |
111 UseIntegratedAssembler = NewValue; | |
112 } | |
113 | |
114 bool getUseSandboxing() const { return UseSandboxing; } | |
115 void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; } | |
116 | |
117 // IceString accessors. | |
118 | |
119 const IceString &getDefaultGlobalPrefix() const { | |
120 return DefaultGlobalPrefix; | |
121 } | |
122 void setDefaultGlobalPrefix(const IceString &NewValue) { | |
123 DefaultGlobalPrefix = NewValue; | |
124 } | |
125 | |
126 const IceString &getDefaultFunctionPrefix() const { | |
127 return DefaultFunctionPrefix; | |
128 } | |
129 void setDefaultFunctionPrefix(const IceString &NewValue) { | |
130 DefaultFunctionPrefix = NewValue; | |
131 } | |
132 | |
133 const IceString &getTimingFocusOn() const { return TimingFocusOn; } | |
134 void setTimingFocusOn(const IceString &NewValue) { TimingFocusOn = NewValue; } | |
135 | |
136 const IceString &getTranslateOnly() const { return TranslateOnly; } | |
137 void setTranslateOnly(const IceString &NewValue) { TranslateOnly = NewValue; } | |
138 | |
139 const IceString &getVerboseFocusOn() const { return VerboseFocusOn; } | |
140 void setVerboseFocusOn(const IceString &NewValue) { | |
141 VerboseFocusOn = NewValue; | |
142 } | |
143 | |
144 // size_t accessors. | |
145 | |
146 size_t getNumTranslationThreads() const { return NumTranslationThreads; } | |
147 void setNumTranslationThreads(size_t NewValue) { | |
148 NumTranslationThreads = NewValue; | |
149 } | |
150 | |
151 private: | |
152 bool AllowErrorRecovery; | |
153 bool AllowUninitializedGlobals; | |
154 bool DataSections; | |
155 bool DecorateAsm; | |
34 bool DisableInternal; | 156 bool DisableInternal; |
157 bool DisableIRGeneration; | |
158 bool DisableTranslation; | |
159 bool DumpStats; | |
160 bool FunctionSections; | |
161 bool GenerateUnitTestMessages; | |
162 bool PhiEdgeSplit; | |
163 bool StubConstantCalls; | |
35 bool SubzeroTimingEnabled; | 164 bool SubzeroTimingEnabled; |
36 bool DisableTranslation; | 165 bool TimeEachFunction; |
37 bool FunctionSections; | |
38 bool DataSections; | |
39 bool UseELFWriter; | 166 bool UseELFWriter; |
40 bool UseIntegratedAssembler; | 167 bool UseIntegratedAssembler; |
41 bool UseSandboxing; | 168 bool UseSandboxing; |
42 bool PhiEdgeSplit; | 169 |
43 bool DecorateAsm; | |
44 bool DumpStats; | |
45 bool AllowUninitializedGlobals; | |
46 bool TimeEachFunction; | |
47 bool DisableIRGeneration; | |
48 bool AllowErrorRecovery; | |
49 bool StubConstantCalls; | |
50 bool GenerateUnitTestMessages; | |
51 size_t NumTranslationThreads; // 0 means completely sequential | |
52 IceString DefaultGlobalPrefix; | 170 IceString DefaultGlobalPrefix; |
53 IceString DefaultFunctionPrefix; | 171 IceString DefaultFunctionPrefix; |
Jim Stichnoth
2015/02/06 13:16:08
Put DefaultFunctionPrefix before DefaultGlobalPref
Karl
2015/02/09 22:20:43
Done.
| |
54 IceString TimingFocusOn; | 172 IceString TimingFocusOn; |
173 IceString TranslateOnly; | |
55 IceString VerboseFocusOn; | 174 IceString VerboseFocusOn; |
56 IceString TranslateOnly; | 175 |
176 size_t NumTranslationThreads; // 0 means completely sequential | |
57 }; | 177 }; |
58 | 178 |
59 } // end of namespace Ice | 179 } // end of namespace Ice |
60 | 180 |
61 #endif // SUBZERO_SRC_ICECLFLAGS_H | 181 #endif // SUBZERO_SRC_ICECLFLAGS_H |
OLD | NEW |