Skip to content

Commit c044709

Browse files
author
Paul C. Anagnostopoulos
committed
[TableGen] Clean up more .td files
Differential Revision: https://reviews.llvm.org/D91431
1 parent 6861d93 commit c044709

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
lines changed

llvm/include/llvm/Frontend/Directive/DirectiveBase.td

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class DirectiveLanguage {
3535

3636
// Make the enum values available in the namespace. This allows us to
3737
// write something like Enum_X if we have a `using namespace cppNamespace`.
38-
bit makeEnumAvailableInNamespace = 0;
38+
bit makeEnumAvailableInNamespace = false;
3939

4040
// Generate include and macro to enable LLVM BitmaskEnum.
41-
bit enableBitmaskEnumInNamespace = 0;
41+
bit enableBitmaskEnumInNamespace = false;
4242

4343
// Header file included in the implementation code generated. Ususally the
4444
// output file of the declaration code generation. Can be left blank.
@@ -63,7 +63,7 @@ class ClauseVal<string n, int v, bit uv> {
6363
bit isUserValue = uv;
6464

6565
// Set clause value used by default when unknown.
66-
bit isDefault = 0;
66+
bit isDefault = false;
6767
}
6868

6969
// Information about a specific clause.
@@ -87,27 +87,27 @@ class Clause<string c> {
8787
// Optional class holding value of the clause in flang AST.
8888
string flangClassValue = "";
8989

90-
// If set to 1, value is optional. Not optional by default.
91-
bit isValueOptional = 0;
90+
// If set to true, value is optional. Not optional by default.
91+
bit isValueOptional = false;
9292

9393
// Name of enum when there is a list of allowed clause values.
9494
string enumClauseValue = "";
9595

9696
// List of allowed clause values
9797
list<ClauseVal> allowedClauseValues = [];
98-
// If set to 1, value class is part of a list. Single class by default.
99-
bit isValueList = 0;
98+
// If set to true, value class is part of a list. Single class by default.
99+
bit isValueList = false;
100100

101101
// Define a default value such as "*".
102102
string defaultValue = "";
103103

104104
// Is clause implicit? If clause is set as implicit, the default kind will
105105
// be return in get<LanguageName>ClauseKind instead of their own kind.
106-
bit isImplicit = 0;
106+
bit isImplicit = false;
107107

108108
// Set clause used by default when unknown. Function returning the kind
109109
// of enumeration will use this clause as the default.
110-
bit isDefault = 0;
110+
bit isDefault = false;
111111
}
112112

113113
// Hold information about clause validity by version.
@@ -148,5 +148,5 @@ class Directive<string d> {
148148
list<VersionedClause> requiredClauses = [];
149149

150150
// Set directive used by default when unknown.
151-
bit isDefault = 0;
151+
bit isDefault = false;
152152
}

llvm/include/llvm/Frontend/OpenACC/ACC.td

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def OpenACC : DirectiveLanguage {
2121
let cppNamespace = "acc"; // final namespace will be llvm::acc
2222
let directivePrefix = "ACCD_";
2323
let clausePrefix = "ACCC_";
24-
let makeEnumAvailableInNamespace = 1;
25-
let enableBitmaskEnumInNamespace = 1;
24+
let makeEnumAvailableInNamespace = true;
25+
let enableBitmaskEnumInNamespace = true;
2626
let includeHeader = "llvm/Frontend/OpenACC/ACC.h.inc";
2727
let clauseEnumSetClass = "AccClauseSet";
2828
let flangClauseBaseClass = "AccClause";
@@ -35,7 +35,7 @@ def OpenACC : DirectiveLanguage {
3535
// 2.16.1
3636
def ACCC_Async : Clause<"async"> {
3737
let flangClassValue = "ScalarIntExpr";
38-
let isValueOptional = 1;
38+
let isValueOptional = true;
3939
}
4040

4141
// 2.9.6
@@ -123,8 +123,8 @@ def ACCC_DeviceResident : Clause<"device_resident"> {
123123
def ACCC_DeviceType : Clause<"device_type"> {
124124
let flangClassValue = "ScalarIntExpr";
125125
let defaultValue = "*";
126-
let isValueOptional = 1;
127-
let isValueList = 1;
126+
let isValueOptional = true;
127+
let isValueList = true;
128128
}
129129

130130
// 2.6.6
@@ -138,7 +138,7 @@ def ACCC_FirstPrivate : Clause<"firstprivate"> {
138138
// 2.9.2
139139
def ACCC_Gang : Clause<"gang"> {
140140
let flangClassValue = "AccGangArgument";
141-
let isValueOptional = 1;
141+
let isValueOptional = true;
142142
}
143143

144144
// 2.14.4
@@ -211,7 +211,7 @@ def ACCC_Reduction : Clause<"reduction"> {
211211
// 2.5.5
212212
def ACCC_Self : Clause<"self"> {
213213
let flangClassValue = "ScalarLogicalExpr";
214-
let isValueOptional = 1;
214+
let isValueOptional = true;
215215
}
216216

217217
// 2.9.5
@@ -220,7 +220,7 @@ def ACCC_Seq : Clause<"seq"> {}
220220
// 2.9.4
221221
def ACCC_Vector : Clause<"vector"> {
222222
let flangClassValue = "ScalarIntExpr";
223-
let isValueOptional = 1;
223+
let isValueOptional = true;
224224
}
225225

226226
// 2.5.10
@@ -231,20 +231,20 @@ def ACCC_VectorLength : Clause<"vector_length"> {
231231
// 2.16.2
232232
def ACCC_Wait : Clause<"wait"> {
233233
let flangClassValue = "AccWaitArgument";
234-
let isValueOptional = 1;
234+
let isValueOptional = true;
235235
}
236236

237237
// 2.9.3
238238
def ACCC_Worker: Clause<"worker"> {
239239
let flangClassValue = "ScalarIntExpr";
240-
let isValueOptional = 1;
240+
let isValueOptional = true;
241241
}
242242

243243
// 2.12
244244
def ACCC_Write : Clause<"write"> {}
245245

246246
def ACCC_Unknown : Clause<"unknown"> {
247-
let isDefault = 1;
247+
let isDefault = true;
248248
}
249249

250250
//===----------------------------------------------------------------------===//
@@ -614,5 +614,5 @@ def ACC_SerialLoop : Directive<"serial loop"> {
614614
}
615615

616616
def ACC_Unknown : Directive<"unknown"> {
617-
let isDefault = 1;
617+
let isDefault = true;
618618
}

llvm/include/llvm/Frontend/OpenMP/OMP.td

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def OpenMP : DirectiveLanguage {
2121
let cppNamespace = "omp"; // final namespace will be llvm::omp
2222
let directivePrefix = "OMPD_";
2323
let clausePrefix = "OMPC_";
24-
let makeEnumAvailableInNamespace = 1;
25-
let enableBitmaskEnumInNamespace = 1;
24+
let makeEnumAvailableInNamespace = true;
25+
let enableBitmaskEnumInNamespace = true;
2626
let includeHeader = "llvm/Frontend/OpenMP/OMP.h.inc";
2727
let clauseEnumSetClass = "OmpClauseSet";
2828
let flangClauseBaseClass = "OmpClause";
@@ -103,7 +103,7 @@ def OMP_PROC_BIND_master : ClauseVal<"master",2,1> {}
103103
def OMP_PROC_BIND_close : ClauseVal<"close",3,1> {}
104104
def OMP_PROC_BIND_spread : ClauseVal<"spread",4,1> {}
105105
def OMP_PROC_BIND_default : ClauseVal<"default",5,0> {}
106-
def OMP_PROC_BIND_unknown : ClauseVal<"unknown",6,0> { let isDefault = 1; }
106+
def OMP_PROC_BIND_unknown : ClauseVal<"unknown",6,0> { let isDefault = true; }
107107
def OMPC_ProcBind : Clause<"proc_bind"> {
108108
let clangClass = "OMPProcBindClause";
109109
let flangClass = "OmpProcBindClause";
@@ -123,7 +123,7 @@ def OMPC_Schedule : Clause<"schedule"> {
123123
def OMPC_Ordered : Clause<"ordered"> {
124124
let clangClass = "OMPOrderedClause";
125125
let flangClassValue = "ScalarIntConstantExpr";
126-
let isValueOptional = 1;
126+
let isValueOptional = true;
127127
}
128128
def OMPC_NoWait : Clause<"nowait"> {
129129
let clangClass = "OMPNowaitClause";
@@ -187,7 +187,7 @@ def OMPC_DistSchedule : Clause<"dist_schedule"> {
187187
let clangClass = "OMPDistScheduleClause";
188188
let flangClass = "OmpDistScheduleClause";
189189
let flangClassValue = "ScalarIntExpr";
190-
let isValueOptional = 1;
190+
let isValueOptional = true;
191191
}
192192
def OMPC_DefaultMap : Clause<"defaultmap"> {
193193
let clangClass = "OMPDefaultmapClause";
@@ -204,12 +204,12 @@ def OMPC_From : Clause<"from"> {
204204
def OMPC_UseDevicePtr : Clause<"use_device_ptr"> {
205205
let clangClass = "OMPUseDevicePtrClause";
206206
let flangClassValue = "Name";
207-
let isValueList = 1;
207+
let isValueList = true;
208208
}
209209
def OMPC_IsDevicePtr : Clause<"is_device_ptr"> {
210210
let clangClass = "OMPIsDevicePtrClause";
211211
let flangClassValue = "Name";
212-
let isValueList = 1;
212+
let isValueList = true;
213213
}
214214
def OMPC_TaskReduction : Clause<"task_reduction"> {
215215
let clangClass = "OMPTaskReductionClause";
@@ -265,25 +265,25 @@ def OMPC_UseDeviceAddr : Clause<"use_device_addr"> {
265265
}
266266
def OMPC_Uniform : Clause<"uniform"> {
267267
let flangClassValue = "Name";
268-
let isValueList = 1;
268+
let isValueList = true;
269269
}
270270
def OMPC_DeviceType : Clause<"device_type"> {}
271271
def OMPC_Match : Clause<"match"> {}
272272
def OMPC_Depobj : Clause<"depobj"> {
273273
let clangClass = "OMPDepobjClause";
274-
let isImplicit = 1;
274+
let isImplicit = true;
275275
}
276276
def OMPC_Flush : Clause<"flush"> {
277277
let clangClass = "OMPFlushClause";
278-
let isImplicit = 1;
278+
let isImplicit = true;
279279
}
280280
def OMPC_ThreadPrivate : Clause<"threadprivate"> {
281281
let alternativeName = "threadprivate or thread local";
282-
let isImplicit = 1;
282+
let isImplicit = true;
283283
}
284284
def OMPC_Unknown : Clause<"unknown"> {
285-
let isImplicit = 1;
286-
let isDefault = 1;
285+
let isImplicit = true;
286+
let isDefault = true;
287287
}
288288
def OMPC_Link : Clause<"link"> {
289289
let flangClassValue = "OmpObjectList";
@@ -1585,5 +1585,5 @@ def OMP_EndSections : Directive<"end sections"> {}
15851585
def OMP_EndSingle : Directive<"end single"> {}
15861586
def OMP_EndWorkshare : Directive<"end workshare"> {}
15871587
def OMP_Unknown : Directive<"unknown"> {
1588-
let isDefault = 1;
1588+
let isDefault = true;
15891589
}

llvm/include/llvm/Option/OptParser.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Define the kinds of options.
1515

16-
class OptionKind<string name, int precedence = 0, bit sentinel = 0> {
16+
class OptionKind<string name, int precedence = 0, bit sentinel = false> {
1717
string Name = name;
1818
// The kind precedence, kinds with lower precedence are matched first.
1919
int Precedence = precedence;
@@ -24,9 +24,9 @@ class OptionKind<string name, int precedence = 0, bit sentinel = 0> {
2424
// An option group.
2525
def KIND_GROUP : OptionKind<"Group">;
2626
// The input option kind.
27-
def KIND_INPUT : OptionKind<"Input", 1, 1>;
27+
def KIND_INPUT : OptionKind<"Input", 1, true>;
2828
// The unknown option kind.
29-
def KIND_UNKNOWN : OptionKind<"Unknown", 2, 1>;
29+
def KIND_UNKNOWN : OptionKind<"Unknown", 2, true>;
3030
// A flag with no values.
3131
def KIND_FLAG : OptionKind<"Flag">;
3232
// An option which prefixes its (single) value.
@@ -99,7 +99,7 @@ class Option<list<string> prefixes, string name, OptionKind kind> {
9999
list<string> AliasArgs = [];
100100
code KeyPath = ?;
101101
code DefaultValue = ?;
102-
bit ShouldAlwaysEmit = 0;
102+
bit ShouldAlwaysEmit = false;
103103
code NormalizerRetTy = ?;
104104
code NormalizedValuesScope = "";
105105
code Normalizer = "";
@@ -175,7 +175,7 @@ class MarshallingInfoBitfieldFlag<code keypath, code value>
175175
class IsNegative {
176176
// todo: create & apply a normalizer for negative flags
177177
}
178-
class AlwaysEmit { bit ShouldAlwaysEmit = 1; }
178+
class AlwaysEmit { bit ShouldAlwaysEmit = true; }
179179
class Normalizer<code normalizer> { code Normalizer = normalizer; }
180180
class Denormalizer<code denormalizer> { code Denormalizer = denormalizer; }
181181
class NormalizedValuesScope<code scope> { code NormalizedValuesScope = scope; }

llvm/include/llvm/TableGen/SearchableTable.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class GenericTable {
103103
string PrimaryKeyName;
104104

105105
// See SearchIndex.EarlyOut
106-
bit PrimaryKeyEarlyOut = 0;
106+
bit PrimaryKeyEarlyOut = false;
107107
}
108108

109109
// Define a record derived from this class to generate an additional search
@@ -124,7 +124,7 @@ class SearchIndex {
124124
// instructions.
125125
//
126126
// Can only be used when the first field is an integral (non-string) type.
127-
bit EarlyOut = 0;
127+
bit EarlyOut = false;
128128
}
129129

130130
// Legacy table type with integrated enum.

0 commit comments

Comments
 (0)