Skip to content

Commit cd5045a

Browse files
committed
[ValueTypes] Use bit instead of int for boolean fields in ValueTypes.td. NFC
1 parent 6127f15 commit cd5045a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

llvm/include/llvm/CodeGen/ValueTypes.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class ValueType<int size, int value> {
1818
int Value = value;
1919
int nElem = 1;
2020
ValueType ElementType = ?;
21-
int isOverloaded = false;
22-
int isInteger = false;
23-
int isFP = false;
24-
int isVector = false;
25-
int isScalable = false;
21+
bit isOverloaded = false;
22+
bit isInteger = false;
23+
bit isFP = false;
24+
bit isVector = false;
25+
bit isScalable = false;
2626
}
2727

2828
class VTAny<int value> : ValueType<0, value> {

llvm/utils/TableGen/VTEmitter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ void VTEmitter::run(raw_ostream &OS) {
6868
continue;
6969
auto Name = VT->getValueAsString("LLVMName");
7070
auto Value = VT->getValueAsInt("Value");
71-
bool IsInteger = VT->getValueAsInt("isInteger");
72-
bool IsFP = VT->getValueAsInt("isFP");
73-
bool IsVector = VT->getValueAsInt("isVector");
74-
bool IsScalable = VT->getValueAsInt("isScalable");
71+
bool IsInteger = VT->getValueAsBit("isInteger");
72+
bool IsFP = VT->getValueAsBit("isFP");
73+
bool IsVector = VT->getValueAsBit("isVector");
74+
bool IsScalable = VT->getValueAsBit("isScalable");
7575

7676
UpdateVTRange("INTEGER_FIXEDLEN_VECTOR_VALUETYPE", Name,
7777
IsInteger && IsVector && !IsScalable);
@@ -92,7 +92,7 @@ void VTEmitter::run(raw_ostream &OS) {
9292
<< Name << ", "
9393
<< Value << ", "
9494
<< VT->getValueAsInt("Size") << ", "
95-
<< VT->getValueAsInt("isOverloaded") << ", "
95+
<< VT->getValueAsBit("isOverloaded") << ", "
9696
<< (IsInteger ? Name[0] == 'i' ? 3 : 1 : 0) << ", "
9797
<< (IsFP ? Name[0] == 'f' ? 3 : 1 : 0) << ", "
9898
<< IsVector << ", "
@@ -111,14 +111,14 @@ void VTEmitter::run(raw_ostream &OS) {
111111

112112
OS << "#ifdef GET_VT_VECATTR // (Ty, Sc, nElem, ElTy, ElSz)\n";
113113
for (const auto *VT : VTsByNumber) {
114-
if (!VT || !VT->getValueAsInt("isVector"))
114+
if (!VT || !VT->getValueAsBit("isVector"))
115115
continue;
116116
const auto *ElTy = VT->getValueAsDef("ElementType");
117117
assert(ElTy);
118118
// clang-format off
119119
OS << " GET_VT_VECATTR("
120120
<< VT->getValueAsString("LLVMName") << ", "
121-
<< VT->getValueAsInt("isScalable") << ", "
121+
<< VT->getValueAsBit("isScalable") << ", "
122122
<< VT->getValueAsInt("nElem") << ", "
123123
<< ElTy->getName() << ", "
124124
<< ElTy->getValueAsInt("Size") << ")\n";

0 commit comments

Comments
 (0)