From 384bc57a2e175a50da206fa1600824f387f4ecb1 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Fri, 31 Jan 2025 09:58:05 -0800 Subject: [PATCH] [TableGen] Restore OpName::OPERAND_LAST emission in InstrInfoEmitter - Looks like this sentinel value is used in some downstream backends, so restore emitting it. - It now also has the correct value (earlier code may hve emitted an incorrect value for OPERAND_LAST and hence it was removed in https://github.com/llvm/llvm-project/pull/124960) --- llvm/utils/TableGen/InstrInfoEmitter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp index 55e9d576b9b06..97c00ad492419 100644 --- a/llvm/utils/TableGen/InstrInfoEmitter.cpp +++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp @@ -286,6 +286,7 @@ void InstrInfoEmitter::emitOperandNameMappings( OS << "enum {\n"; for (const auto &[I, Op] : enumerate(OperandNameToID)) OS << " " << Op.first << " = " << I << ",\n"; + OS << " OPERAND_LAST = " << NumOperandNames << ",\n"; OS << "};\n"; OS << "} // end namespace llvm::" << Namespace << "::OpName\n"; OS << "#endif //GET_INSTRINFO_OPERAND_ENUM\n\n";