eliminate the old InstFormatName which is always "AsmString",
authorChris Lattner <sabre@nondot.org>
Mon, 1 Nov 2010 02:15:23 +0000 (02:15 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 1 Nov 2010 02:15:23 +0000 (02:15 +0000)
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
utils/TableGen/AsmMatcherEmitter.cpp
utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/CodeGenInstruction.h
utils/TableGen/CodeGenTarget.cpp

index 57485602d7bd0a0a2ab277de12b4af265f6e73fe..5aabc9d639a5074346b77758bd8387d8fad48527 100644 (file)
@@ -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
index c047a5d99368a03283f0cd782386c76837fa1580..37a8c8f79bbbac2c308e538184191c8f45825f6a 100644 (file)
@@ -945,7 +945,7 @@ void AsmMatcherInfo::BuildInfo() {
 
     Instructions.push_back(II.take());
   }
-
+  
   // Build info for the register classes.
   BuildRegisterClasses(SingletonRegisters);
 
index f7b45e243a428500c750ac86a7a62fcbf4a419a3..41a27cea3ddf557b3cb2494de6657535cf01f225 100644 (file)
@@ -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");
index 93d1ce1ddfdbb516154e398d2822fdb42f564f54..33701ec0110ad737ee75061c38e94b0d045a6696 100644 (file)
@@ -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
index c9b6fc2d26afaf137156077ad3199fd22f6f5c26..7a1c4f7b50c6318a5de53ebadb6e42693c2b0aab 100644 (file)
@@ -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 *