From f78081145695baa5d0b004e674c4561245b13b52 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 1 Nov 2010 02:15:23 +0000 Subject: [PATCH] eliminate the old InstFormatName which is always "AsmString", simplify CodeGenInstruction. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117891 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/Target.td | 4 ---- utils/TableGen/AsmMatcherEmitter.cpp | 2 +- utils/TableGen/CodeGenInstruction.cpp | 4 ++-- utils/TableGen/CodeGenInstruction.h | 2 +- utils/TableGen/CodeGenTarget.cpp | 9 ++------- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 57485602d7b..5aabc9d639a 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -593,10 +593,6 @@ class AsmWriter { // name. string AsmWriterClassName = "AsmPrinter"; - // InstFormatName - AsmWriters can specify the name of the format string to - // print instructions with. - string InstFormatName = "AsmString"; - // Variant - AsmWriters can be of multiple different variants. Variants are // used to support targets that need to emit assembly code in ways that are // mostly the same for different targets, but have minor differences in diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index c047a5d9936..37a8c8f79bb 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -945,7 +945,7 @@ void AsmMatcherInfo::BuildInfo() { Instructions.push_back(II.take()); } - + // Build info for the register classes. BuildRegisterClasses(SingletonRegisters); diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp index f7b45e243a4..41a27cea3dd 100644 --- a/utils/TableGen/CodeGenInstruction.cpp +++ b/utils/TableGen/CodeGenInstruction.cpp @@ -95,9 +95,9 @@ static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) { } } -CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr) - : TheDef(R), AsmString(AsmStr) { +CodeGenInstruction::CodeGenInstruction(Record *R) : TheDef(R) { Namespace = R->getValueAsString("Namespace"); + AsmString = R->getValueAsString("AsmString"); isReturn = R->getValueAsBit("isReturn"); isBranch = R->getValueAsBit("isBranch"); diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index 93d1ce1ddfd..33701ec0110 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -185,7 +185,7 @@ namespace llvm { return false; } - CodeGenInstruction(Record *R, const std::string &AsmStr); + CodeGenInstruction(Record *R); /// getOperandNamed - Return the index of the operand with the specified /// non-empty name. If the instruction does not have an operand with the diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index c9b6fc2d26a..7a1c4f7b50c 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -295,13 +295,8 @@ void CodeGenTarget::ReadInstructions() const { throw std::string("No 'Instruction' subclasses defined!"); // Parse the instructions defined in the .td file. - std::string InstFormatName = - getAsmWriter()->getValueAsString("InstFormatName"); - - for (unsigned i = 0, e = Insts.size(); i != e; ++i) { - std::string AsmStr = Insts[i]->getValueAsString(InstFormatName); - Instructions[Insts[i]] = new CodeGenInstruction(Insts[i], AsmStr); - } + for (unsigned i = 0, e = Insts.size(); i != e; ++i) + Instructions[Insts[i]] = new CodeGenInstruction(Insts[i]); } static const CodeGenInstruction * -- 2.34.1