Skip to content

Commit 7bb6d64

Browse files
committed
[CHERI] Generate the FIRST_CAPABILITY_VALUETYPE and LAST_CAPABILITY_VALUETYPE sentinels from TableGen
1 parent 3233dc8 commit 7bb6d64

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

llvm/include/llvm/CodeGen/ValueTypes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ValueType<int size, int value> {
2828
// Indicates this VT should be included in the
2929
// [FIRST_VALUETYPE,LAST_VALUETYPE] range.
3030
bit isNormalValueType = true;
31-
int isCapability = false;
31+
bit isCapability = false;
3232
}
3333

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

llvm/include/llvm/CodeGenTypes/MachineValueType.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ namespace llvm {
4747
#undef GET_VT_ATTR
4848
#undef GET_VT_RANGES
4949

50-
// CHERI-TODO: Integrate this properly into tablegen
51-
FIRST_CAPABILITY_VALUETYPE = c64,
52-
LAST_CAPABILITY_VALUETYPE = c256,
53-
5450
VALUETYPE_SIZE = LAST_VALUETYPE + 1,
5551
};
5652

llvm/utils/TableGen/Basic/VTEmitter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ void VTEmitter::run(raw_ostream &OS) {
132132
bool IsVector = VT->getValueAsBit("isVector");
133133
bool IsScalable = VT->getValueAsBit("isScalable");
134134
bool IsRISCVVecTuple = VT->getValueAsBit("isRISCVVecTuple");
135+
bool IsCapability = VT->getValueAsBit("isCapability");
135136
int64_t NF = VT->getValueAsInt("NF");
136137
bool IsNormalValueType = VT->getValueAsBit("isNormalValueType");
137138
int64_t NElem = IsVector ? VT->getValueAsInt("nElem") : 0;
@@ -152,6 +153,7 @@ void VTEmitter::run(raw_ostream &OS) {
152153
UpdateVTRange("INTEGER_VALUETYPE", Name, IsInteger && !IsVector);
153154
UpdateVTRange("FP_VALUETYPE", Name, IsFP && !IsVector);
154155
UpdateVTRange("VALUETYPE", Name, IsNormalValueType);
156+
UpdateVTRange("CAPABILITY_VALUETYPE", Name, IsCapability);
155157

156158
// clang-format off
157159
OS << " GET_VT_ATTR("

0 commit comments

Comments
 (0)