diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-04-02 07:01:04 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-04-02 07:01:04 +0000 |
commit | dab9e35ad05afef53e15e57462a0b85943a64735 (patch) | |
tree | 7644363a90d1bc291d5bdfa7aa21a930f3f90ecb /llvm/utils/TableGen/AsmWriterEmitter.cpp | |
parent | 8e52bdce7bea9e9b0ad99768a2d902d3590e4188 (diff) | |
download | bcm5719-llvm-dab9e35ad05afef53e15e57462a0b85943a64735.tar.gz bcm5719-llvm-dab9e35ad05afef53e15e57462a0b85943a64735.zip |
Remove getInstructionName from MCInstPrinter implementations in favor of using the instruction name table from MCInstrInfo. Reduces static data in the InstPrinter implementations.
llvm-svn: 153863
Diffstat (limited to 'llvm/utils/TableGen/AsmWriterEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/AsmWriterEmitter.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp index de2dc512504..bc6345467e3 100644 --- a/llvm/utils/TableGen/AsmWriterEmitter.cpp +++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp @@ -565,54 +565,6 @@ void AsmWriterEmitter::EmitGetRegisterName(raw_ostream &O) { << "}\n"; } -void AsmWriterEmitter::EmitGetInstructionName(raw_ostream &O) { - CodeGenTarget Target(Records); - Record *AsmWriter = Target.getAsmWriter(); - std::string ClassName = AsmWriter->getValueAsString("AsmWriterClassName"); - - const std::vector<const CodeGenInstruction*> &NumberedInstructions = - Target.getInstructionsByEnumValue(); - - O << -"\n\n#ifdef GET_INSTRUCTION_NAME\n" -"#undef GET_INSTRUCTION_NAME\n\n" -"/// getInstructionName: This method is automatically generated by tblgen\n" -"/// from the instruction set description. This returns the enum name of the\n" -"/// specified instruction.\n" - << "const char *" << Target.getName() << ClassName - << "::getInstructionName(unsigned Opcode) {\n" - << " assert(Opcode < " << NumberedInstructions.size() - << " && \"Invalid instruction number!\");\n" - << "\n"; - - SequenceToOffsetTable<std::string> StringTable; - for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) { - const CodeGenInstruction &Inst = *NumberedInstructions[i]; - StringTable.add(Inst.TheDef->getName()); - } - - StringTable.layout(); - O << " static const char Strs[] = {\n"; - StringTable.emit(O, printChar); - O << " };\n\n"; - - O << " static const unsigned InstAsmOffset[] = {"; - for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) { - const CodeGenInstruction &Inst = *NumberedInstructions[i]; - - std::string AsmName = Inst.TheDef->getName(); - if ((i % 14) == 0) - O << "\n "; - - O << StringTable.get(AsmName) << ", "; - } - O << " };\n" - << "\n"; - - O << " return Strs+InstAsmOffset[Opcode];\n" - << "}\n\n#endif\n"; -} - namespace { // IAPrinter - Holds information about an InstAlias. Two InstAliases match if // they both have the same conditionals. In which case, we cannot print out the @@ -965,7 +917,6 @@ void AsmWriterEmitter::run(raw_ostream &O) { EmitPrintInstruction(O); EmitGetRegisterName(O); - EmitGetInstructionName(O); EmitPrintAliasInstruction(O); } |