Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions llvm/utils/TableGen/InstrInfoEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ void InstrInfoEmitter::emitOperandNameMappings(
assert(MaxOperandNo <= INT16_MAX &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS << "assert(NamesIdx < OPERAND_LAST);"; ?

"Too many operands for the operand name -> index table");
StringRef Type = MaxOperandNo <= INT8_MAX ? "int8_t" : "int16_t";
OS << " static constexpr " << Type << " OperandMap[][" << NumOperandNames
<< "] = {\n";
OS << " static constexpr " << Type << " OperandMap[]["
<< NumOperandNames + 1 << "] = {\n";
for (const auto &Entry : OperandMap) {
const std::map<unsigned, unsigned> &OpList = Entry.first;

Expand All @@ -311,7 +311,8 @@ void InstrInfoEmitter::emitOperandNameMappings(
auto Iter = OpList.find(ID);
OS << (Iter != OpList.end() ? (int)Iter->second : -1) << ", ";
}
OS << "},\n";
// value for OPERAND_LAST
OS << "-1 },\n";
}
OS << " };\n";

Expand Down