Skip to content

Commit 24f8d10

Browse files
committed
[TableGen] Add an explicit cast to allow one TypeSetByHwMode constructor to be removed. NFC
This constructor was taking a ValueTypeByMode by value to create an ArrayRef. By adding an explicit cast from ValueTypeByHwMode to TypeSetByHwMode we allow the ArrayRef to be implicitly converted from a single element.
1 parent c2dc46c commit 24f8d10

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

llvm/utils/TableGen/Common/CodeGenDAGPatterns.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ struct TypeSetByHwMode : public InfoByHwMode<MachineValueTypeSet> {
193193
TypeSetByHwMode &operator=(const TypeSetByHwMode &) = default;
194194
TypeSetByHwMode(MVT::SimpleValueType VT)
195195
: TypeSetByHwMode(ValueTypeByHwMode(VT)) {}
196-
TypeSetByHwMode(ValueTypeByHwMode VT)
197-
: TypeSetByHwMode(ArrayRef<ValueTypeByHwMode>(&VT, 1)) {}
198196
TypeSetByHwMode(ArrayRef<ValueTypeByHwMode> VTList);
199197

200198
SetType &getOrCreate(unsigned Mode) { return Map[Mode]; }

llvm/utils/TableGen/GlobalISelEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ Error GlobalISelEmitter::importChildMatcher(
11621162
OperandMatcher &OM =
11631163
InsnOperand.getInsnMatcher().addOperand(0, "", TempOpIdx);
11641164
if (auto Error =
1165-
OM.addTypeCheckPredicate(VTy, false /* OperandIsAPointer */))
1165+
OM.addTypeCheckPredicate(TypeSetByHwMode(VTy), false /* OperandIsAPointer */))
11661166
return failedImport(toString(std::move(Error)) +
11671167
" for result of Src pattern operator");
11681168

0 commit comments

Comments
 (0)