Revert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo."
We cannot limit the concatenated instruction names to 64K. ARM is
already at 32K, and it is easy to imagine a target with more
instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152817 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp
index 43ff203..0d27828 100644
--- a/utils/TableGen/InstrInfoEmitter.cpp
+++ b/utils/TableGen/InstrInfoEmitter.cpp
@@ -213,20 +213,18 @@
OperandInfoIDs, OS);
OS << "};\n\n";
- OS << "extern const uint16_t " << TargetName <<"InstrNameIndices[] = {\n ";
+ OS << "extern const unsigned " << TargetName <<"InstrNameIndices[] = {\n ";
StringToOffsetTable StringTable;
for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
const CodeGenInstruction *Instr = NumberedInstructions[i];
- unsigned Idx = StringTable.GetOrAddStringOffset(Instr->TheDef->getName());
- assert(Idx <= 0xffff && "String offset too large to fit in table");
- OS << Idx << "U, ";
+ OS << StringTable.GetOrAddStringOffset(Instr->TheDef->getName()) << "U, ";
if (i % 8 == 0)
OS << "\n ";
}
OS << "\n};\n\n";
- OS << "extern const char *const " << TargetName << "InstrNameData =\n";
+ OS << "const char *" << TargetName << "InstrNameData =\n";
StringTable.EmitString(OS);
OS << ";\n\n";
@@ -259,8 +257,8 @@
OS << "namespace llvm {\n";
OS << "extern const MCInstrDesc " << TargetName << "Insts[];\n";
- OS << "extern const uint16_t " << TargetName << "InstrNameIndices[];\n";
- OS << "extern const char *const " << TargetName << "InstrNameData;\n";
+ OS << "extern const unsigned " << TargetName << "InstrNameIndices[];\n";
+ OS << "extern const char *" << TargetName << "InstrNameData;\n";
OS << ClassName << "::" << ClassName << "(int SO, int DO)\n"
<< " : TargetInstrInfoImpl(SO, DO) {\n"
<< " InitMCInstrInfo(" << TargetName << "Insts, "