Revert r152202 as it's causing internal buildbot failures.
[oota-llvm.git] / utils / TableGen / AsmMatcherEmitter.cpp
index 4afee215234077d3527e7f3dd48e4a3dae9f9996..cdcc496e7d4b26a55798b9557d37fce31dbab06c 100644 (file)
@@ -2023,7 +2023,7 @@ static void EmitCustomOperandParsing(raw_ostream &OS, CodeGenTarget &Target,
   // Emit the static custom operand parsing table;
   OS << "namespace {\n";
   OS << "  struct OperandMatchEntry {\n";
-  OS << "    static const char *const MnemonicTable;\n";
+  OS << "    static const char *MnemonicTable;\n";
   OS << "    unsigned OperandMask;\n";
   OS << "    uint16_t Mnemonic;\n";
   OS << "    " << getMinimalTypeForRange(Info.Classes.size())
@@ -2079,9 +2079,8 @@ static void EmitCustomOperandParsing(raw_ostream &OS, CodeGenTarget &Target,
 
     // Store a pascal-style length byte in the mnemonic.
     std::string LenMnemonic = char(II.Mnemonic.size()) + II.Mnemonic.str();
-    unsigned Idx = StringTable.GetOrAddStringOffset(LenMnemonic, false);
-    assert(Idx <= 0xffff && "String offset too large to fit in table");
-    OS << ", " << Idx << " /* " << II.Mnemonic << " */";
+    OS << ", " << StringTable.GetOrAddStringOffset(LenMnemonic, false)
+       << " /* " << II.Mnemonic << " */";
 
     OS << ", " << OMI.CI->Name
        << ", ";
@@ -2098,7 +2097,7 @@ static void EmitCustomOperandParsing(raw_ostream &OS, CodeGenTarget &Target,
   }
   OS << "};\n\n";
 
-  OS << "const char *const OperandMatchEntry::MnemonicTable =\n";
+  OS << "const char *OperandMatchEntry::MnemonicTable =\n";
   StringTable.EmitString(OS);
   OS << ";\n\n";
 
@@ -2321,7 +2320,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
   // following the mnemonic.
   OS << "namespace {\n";
   OS << "  struct MatchEntry {\n";
-  OS << "    static const char *const MnemonicTable;\n";
+  OS << "    static const char *MnemonicTable;\n";
   OS << "    uint16_t Opcode;\n";
   OS << "    uint16_t Mnemonic;\n";
   OS << "    " << getMinimalTypeForRange(Info.Matchables.size())
@@ -2364,11 +2363,10 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
 
     // Store a pascal-style length byte in the mnemonic.
     std::string LenMnemonic = char(II.Mnemonic.size()) + II.Mnemonic.str();
-    unsigned Idx = StringTable.GetOrAddStringOffset(LenMnemonic, false);
-    assert(Idx <= 0xffff && "String offset too large to fit in table");
     OS << "  { " << Target.getName() << "::"
        << II.getResultInst()->TheDef->getName() << ", "
-       << Idx << " /* " << II.Mnemonic << " */"
+       << StringTable.GetOrAddStringOffset(LenMnemonic, false)
+       << " /* " << II.Mnemonic << " */"
        << ", " << II.ConversionFnKind << ", { ";
     for (unsigned i = 0, e = II.AsmOperands.size(); i != e; ++i) {
       MatchableInfo::AsmOperand &Op = II.AsmOperands[i];
@@ -2392,7 +2390,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
 
   OS << "};\n\n";
 
-  OS << "const char *const MatchEntry::MnemonicTable =\n";
+  OS << "const char *MatchEntry::MnemonicTable =\n";
   StringTable.EmitString(OS);
   OS << ";\n\n";