Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: src/IceClFlags.h

Issue 1197863003: Subzero: Reduce the amount of #ifdef'd code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use constexpr inline functions instead of macros Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 void setDisableInternal(bool NewValue) { DisableInternal = NewValue; } 55 void setDisableInternal(bool NewValue) { DisableInternal = NewValue; }
56 56
57 bool getDisableIRGeneration() const { 57 bool getDisableIRGeneration() const {
58 return ALLOW_DISABLE_IR_GEN && DisableIRGeneration; 58 return ALLOW_DISABLE_IR_GEN && DisableIRGeneration;
59 } 59 }
60 void setDisableIRGeneration(bool NewValue) { DisableIRGeneration = NewValue; } 60 void setDisableIRGeneration(bool NewValue) { DisableIRGeneration = NewValue; }
61 61
62 bool getDisableTranslation() const { return DisableTranslation; } 62 bool getDisableTranslation() const { return DisableTranslation; }
63 void setDisableTranslation(bool NewValue) { DisableTranslation = NewValue; } 63 void setDisableTranslation(bool NewValue) { DisableTranslation = NewValue; }
64 64
65 bool getDumpStats() const { return ALLOW_DUMP && DumpStats; } 65 bool getDumpStats() const { return buildAllowsDump() && DumpStats; }
66 void setDumpStats(bool NewValue) { DumpStats = NewValue; } 66 void setDumpStats(bool NewValue) { DumpStats = NewValue; }
67 67
68 bool getEnableBlockProfile() const { return EnableBlockProfile; } 68 bool getEnableBlockProfile() const { return EnableBlockProfile; }
69 void setEnableBlockProfile(bool NewValue) { EnableBlockProfile = NewValue; } 69 void setEnableBlockProfile(bool NewValue) { EnableBlockProfile = NewValue; }
70 70
71 bool getFunctionSections() const { return FunctionSections; } 71 bool getFunctionSections() const { return FunctionSections; }
72 void setFunctionSections(bool NewValue) { FunctionSections = NewValue; } 72 void setFunctionSections(bool NewValue) { FunctionSections = NewValue; }
73 73
74 bool getGenerateUnitTestMessages() const { 74 bool getGenerateUnitTestMessages() const {
75 // Note: If dump routines have been turned off, the error messages 75 // Note: If dump routines have been turned off, the error messages
76 // will not be readable. Hence, turn off. 76 // will not be readable. Hence, turn off.
77 return !ALLOW_DUMP || GenerateUnitTestMessages; 77 return !buildAllowsDump() || GenerateUnitTestMessages;
78 } 78 }
79 void setGenerateUnitTestMessages(bool NewValue) { 79 void setGenerateUnitTestMessages(bool NewValue) {
80 GenerateUnitTestMessages = NewValue; 80 GenerateUnitTestMessages = NewValue;
81 } 81 }
82 82
83 bool getPhiEdgeSplit() const { return PhiEdgeSplit; } 83 bool getPhiEdgeSplit() const { return PhiEdgeSplit; }
84 void setPhiEdgeSplit(bool NewValue) { PhiEdgeSplit = NewValue; } 84 void setPhiEdgeSplit(bool NewValue) { PhiEdgeSplit = NewValue; }
85 85
86 bool shouldDoNopInsertion() const { return RandomNopInsertion; } 86 bool shouldDoNopInsertion() const { return RandomNopInsertion; }
87 void setShouldDoNopInsertion(bool NewValue) { RandomNopInsertion = NewValue; } 87 void setShouldDoNopInsertion(bool NewValue) { RandomNopInsertion = NewValue; }
88 88
89 bool shouldRandomizeRegAlloc() const { return RandomRegAlloc; } 89 bool shouldRandomizeRegAlloc() const { return RandomRegAlloc; }
90 void setShouldRandomizeRegAlloc(bool NewValue) { RandomRegAlloc = NewValue; } 90 void setShouldRandomizeRegAlloc(bool NewValue) { RandomRegAlloc = NewValue; }
91 91
92 bool getSkipUnimplemented() const { return SkipUnimplemented; } 92 bool getSkipUnimplemented() const { return SkipUnimplemented; }
93 void setSkipUnimplemented(bool NewValue) { SkipUnimplemented = NewValue; } 93 void setSkipUnimplemented(bool NewValue) { SkipUnimplemented = NewValue; }
94 94
95 bool getSubzeroTimingEnabled() const { return SubzeroTimingEnabled; } 95 bool getSubzeroTimingEnabled() const { return SubzeroTimingEnabled; }
96 void setSubzeroTimingEnabled(bool NewValue) { 96 void setSubzeroTimingEnabled(bool NewValue) {
97 SubzeroTimingEnabled = NewValue; 97 SubzeroTimingEnabled = NewValue;
98 } 98 }
99 99
100 bool getTimeEachFunction() const { return ALLOW_DUMP && TimeEachFunction; } 100 bool getTimeEachFunction() const { return buildAllowsDump() && TimeEachFunctio n; }
101 void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; } 101 void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; }
102 102
103 bool getUseSandboxing() const { return UseSandboxing; } 103 bool getUseSandboxing() const { return UseSandboxing; }
104 void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; } 104 void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; }
105 105
106 // Enum and integer accessors. 106 // Enum and integer accessors.
107 OptLevel getOptLevel() const { return Opt; } 107 OptLevel getOptLevel() const { return Opt; }
108 void setOptLevel(OptLevel NewValue) { Opt = NewValue; } 108 void setOptLevel(OptLevel NewValue) { Opt = NewValue; }
109 109
110 FileType getOutFileType() const { return OutFileType; } 110 FileType getOutFileType() const { return OutFileType; }
(...skipping 13 matching lines...) Expand all
124 124
125 TargetArch getTargetArch() const { return TArch; } 125 TargetArch getTargetArch() const { return TArch; }
126 void setTargetArch(TargetArch NewValue) { TArch = NewValue; } 126 void setTargetArch(TargetArch NewValue) { TArch = NewValue; }
127 127
128 TargetInstructionSet getTargetInstructionSet() const { return TInstrSet; } 128 TargetInstructionSet getTargetInstructionSet() const { return TInstrSet; }
129 void setTargetInstructionSet(TargetInstructionSet NewValue) { 129 void setTargetInstructionSet(TargetInstructionSet NewValue) {
130 TInstrSet = NewValue; 130 TInstrSet = NewValue;
131 } 131 }
132 132
133 VerboseMask getVerbose() const { 133 VerboseMask getVerbose() const {
134 return ALLOW_DUMP ? VMask : (VerboseMask)IceV_None; 134 return buildAllowsDump() ? VMask : (VerboseMask)IceV_None;
135 } 135 }
136 void setVerbose(VerboseMask NewValue) { VMask = NewValue; } 136 void setVerbose(VerboseMask NewValue) { VMask = NewValue; }
137 137
138 void 138 void
139 setRandomizeAndPoolImmediatesOption(RandomizeAndPoolImmediatesEnum Option) { 139 setRandomizeAndPoolImmediatesOption(RandomizeAndPoolImmediatesEnum Option) {
140 RandomizeAndPoolImmediatesOption = Option; 140 RandomizeAndPoolImmediatesOption = Option;
141 } 141 }
142 142
143 RandomizeAndPoolImmediatesEnum getRandomizeAndPoolImmediatesOption() const { 143 RandomizeAndPoolImmediatesEnum getRandomizeAndPoolImmediatesOption() const {
144 return RandomizeAndPoolImmediatesOption; 144 return RandomizeAndPoolImmediatesOption;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 RandomizeAndPoolImmediatesEnum RandomizeAndPoolImmediatesOption; 231 RandomizeAndPoolImmediatesEnum RandomizeAndPoolImmediatesOption;
232 uint32_t RandomizeAndPoolImmediatesThreshold; 232 uint32_t RandomizeAndPoolImmediatesThreshold;
233 233
234 size_t NumTranslationThreads; // 0 means completely sequential 234 size_t NumTranslationThreads; // 0 means completely sequential
235 uint64_t RandomSeed; 235 uint64_t RandomSeed;
236 }; 236 };
237 237
238 } // end of namespace Ice 238 } // end of namespace Ice
239 239
240 #endif // SUBZERO_SRC_ICECLFLAGS_H 240 #endif // SUBZERO_SRC_ICECLFLAGS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698