diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-15 18:05:57 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-15 18:05:57 +0000 |
commit | bcfa982c4866fee5f86dca8c4bfc7425a9629f0d (patch) | |
tree | 4742e635a91d08f91f917b2355ada716e352689f /utils/TableGen/AsmMatcherEmitter.cpp | |
parent | d66b9a222b38d7d29646c582b70a1c107ca615de (diff) |
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
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 4afee21523..cdcc496e7d 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"; |