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 "IceDefs.h" |
17 #include "IceTypes.h" | 18 #include "IceTypes.h" |
18 | 19 |
19 namespace Ice { | 20 namespace Ice { |
20 | 21 |
| 22 class ClFlagsExtra; |
| 23 |
21 class ClFlags { | 24 class ClFlags { |
22 ClFlags(const ClFlags &) = delete; | 25 ClFlags(const ClFlags &) = delete; |
23 ClFlags &operator=(const ClFlags &) = delete; | 26 ClFlags &operator=(const ClFlags &) = delete; |
24 | 27 |
25 public: | 28 public: |
26 ClFlags() | 29 ClFlags() |
27 : // bool fields. | 30 : // bool fields. |
28 AllowErrorRecovery(false), | 31 AllowErrorRecovery(false), |
29 AllowUninitializedGlobals(false), DataSections(false), | 32 AllowUninitializedGlobals(false), DataSections(false), |
30 DecorateAsm(false), DisableInternal(false), DisableIRGeneration(false), | 33 DecorateAsm(false), DisableInternal(false), DisableIRGeneration(false), |
31 DisableTranslation(false), DumpStats(false), FunctionSections(false), | 34 DisableTranslation(false), DumpStats(false), FunctionSections(false), |
32 GenerateUnitTestMessages(false), PhiEdgeSplit(false), | 35 GenerateUnitTestMessages(false), PhiEdgeSplit(false), |
33 RandomNopInsertion(false), RandomRegAlloc(false), | 36 RandomNopInsertion(false), RandomRegAlloc(false), |
34 SubzeroTimingEnabled(false), TimeEachFunction(false), | 37 SubzeroTimingEnabled(false), TimeEachFunction(false), |
35 UseSandboxing(false), | 38 UseSandboxing(false), |
36 // Enum and integer fields | 39 // Enum and integer fields. |
37 Opt(Opt_m1), OutFileType(FT_Iasm), RandomMaxNopsPerInstruction(0), | 40 Opt(Opt_m1), OutFileType(FT_Iasm), RandomMaxNopsPerInstruction(0), |
38 RandomNopProbabilityAsPercentage(0), TArch(TargetArch_NUM), | 41 RandomNopProbabilityAsPercentage(0), TArch(TargetArch_NUM), |
39 VMask(IceV_None), | 42 VMask(IceV_None), |
40 // IceString fields. | 43 // IceString fields. |
41 DefaultFunctionPrefix(""), DefaultGlobalPrefix(""), TestPrefix(""), | 44 DefaultFunctionPrefix(""), DefaultGlobalPrefix(""), TestPrefix(""), |
42 TimingFocusOn(""), TranslateOnly(""), VerboseFocusOn(""), | 45 TimingFocusOn(""), TranslateOnly(""), VerboseFocusOn(""), |
43 // size_t and 64-bit fields. | 46 // size_t and 64-bit fields. |
44 NumTranslationThreads(0), RandomSeed(0) {} | 47 NumTranslationThreads(0), RandomSeed(0) {} |
45 | 48 |
| 49 static void parseFlags(int argc, char *argv[]); |
| 50 static void getParsedClFlags(ClFlags &OutFlags); |
| 51 static void getParsedClFlagsExtra(ClFlagsExtra &OutFlagsExtra); |
| 52 |
46 // bool accessors. | 53 // bool accessors. |
47 | 54 |
48 bool getAllowErrorRecovery() const { return AllowErrorRecovery; } | 55 bool getAllowErrorRecovery() const { return AllowErrorRecovery; } |
49 void setAllowErrorRecovery(bool NewValue) { AllowErrorRecovery = NewValue; } | 56 void setAllowErrorRecovery(bool NewValue) { AllowErrorRecovery = NewValue; } |
50 | 57 |
51 bool getAllowUninitializedGlobals() const { | 58 bool getAllowUninitializedGlobals() const { |
52 return AllowUninitializedGlobals; | 59 return AllowUninitializedGlobals; |
53 } | 60 } |
54 void setAllowUninitializedGlobals(bool NewValue) { | 61 void setAllowUninitializedGlobals(bool NewValue) { |
55 AllowUninitializedGlobals = NewValue; | 62 AllowUninitializedGlobals = NewValue; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 IceString TranslateOnly; | 218 IceString TranslateOnly; |
212 IceString VerboseFocusOn; | 219 IceString VerboseFocusOn; |
213 | 220 |
214 size_t NumTranslationThreads; // 0 means completely sequential | 221 size_t NumTranslationThreads; // 0 means completely sequential |
215 uint64_t RandomSeed; | 222 uint64_t RandomSeed; |
216 }; | 223 }; |
217 | 224 |
218 } // end of namespace Ice | 225 } // end of namespace Ice |
219 | 226 |
220 #endif // SUBZERO_SRC_ICECLFLAGS_H | 227 #endif // SUBZERO_SRC_ICECLFLAGS_H |
OLD | NEW |