diff options
Diffstat (limited to 'utils/TableGen/AsmMatcherEmitter.cpp')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 4afee21..cdcc496 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -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"; |