Revert r152202 as it's causing internal buildbot failures.

Original commit message:
Use uint16_t to store InstrNameIndices in MCInstrInfo. Add asserts to protect 
all 16-bit string table offsets. Also make sure the string to offset table 
string is not larger than 65536 characters since larger string literals aren't 
portable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier
2012-03-07 17:06:40 +00:00
parent a2da78852b
commit 3c777947f4
5 changed files with 17 additions and 29 deletions
+3 -8
View File
@@ -306,7 +306,6 @@ void AsmWriterEmitter::EmitPrintInstruction(raw_ostream &O) {
}
// Bias offset by one since we want 0 as a sentinel.
assert((Idx+1) <= 0xffff && "String offset too large to fit in table");
OpcodeInfo.push_back(Idx+1);
}
@@ -374,7 +373,7 @@ void AsmWriterEmitter::EmitPrintInstruction(raw_ostream &O) {
O << " };\n\n";
// Emit the string itself.
O << " const char *const AsmStrs = \n";
O << " const char *AsmStrs = \n";
StringTable.EmitString(O);
O << ";\n\n";
@@ -497,9 +496,7 @@ emitRegisterNameString(raw_ostream &O, StringRef AltName,
}
}
unsigned Idx = StringTable.GetOrAddStringOffset(AsmName);
assert(Idx <= 0xffff && "String offset too large to fit in table");
O << Idx;
O << StringTable.GetOrAddStringOffset(AsmName);
if (((i + 1) % 14) == 0)
O << ",\n ";
else
@@ -594,9 +591,7 @@ void AsmWriterEmitter::EmitGetInstructionName(raw_ostream &O) {
if ((i % 14) == 0)
O << "\n ";
unsigned Idx = StringTable.GetOrAddStringOffset(AsmName);
assert(Idx <= 0xffff && "String offset too large to fit in table");
O << Idx << ", ";
O << StringTable.GetOrAddStringOffset(AsmName) << ", ";
}
O << "0\n"
<< " };\n"