[llvm-commits] [llvm] r95715 - in /llvm/trunk/utils/TableGen: AsmWriterEmitter.cpp AsmWriterInst.cpp AsmWriterInst.h EDEmitter.cpp

Sean Callanan scallanan at apple.com
Tue Feb 9 15:06:36 PST 2010


Author: spyffe
Date: Tue Feb  9 17:06:35 2010
New Revision: 95715

URL: http://llvm.org/viewvc/llvm-project?rev=95715&view=rev
Log:
Fixed some indentation in the AsmWriterInst
implementation.  Also changed the constructor
so that it does not require a Record, making it
usable by the EDEmitter.

Modified:
    llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
    llvm/trunk/utils/TableGen/AsmWriterInst.cpp
    llvm/trunk/utils/TableGen/AsmWriterInst.h
    llvm/trunk/utils/TableGen/EDEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=95715&r1=95714&r2=95715&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Tue Feb  9 17:06:35 2010
@@ -256,7 +256,11 @@
          E = Target.inst_end(); I != E; ++I)
     if (!I->second.AsmString.empty() &&
         I->second.TheDef->getName() != "PHI")
-      Instructions.push_back(AsmWriterInst(I->second, AsmWriter));
+      Instructions.push_back(
+        AsmWriterInst(I->second, 
+                      AsmWriter->getValueAsInt("Variant"),
+                      AsmWriter->getValueAsInt("FirstOperandColumn"),
+                      AsmWriter->getValueAsInt("OperandSpacing")));
 
   // Get the instruction numbering.
   Target.getInstructionsByEnumValue(NumberedInstructions);

Modified: llvm/trunk/utils/TableGen/AsmWriterInst.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterInst.cpp?rev=95715&r1=95714&r2=95715&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterInst.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterInst.cpp Tue Feb  9 17:06:35 2010
@@ -46,13 +46,12 @@
 /// ParseAsmString - Parse the specified Instruction's AsmString into this
 /// AsmWriterInst.
 ///
-AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, Record *AsmWriter) {
+AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI,
+                             unsigned Variant,
+                             int FirstOperandColumn,
+                             int OperandSpacing) {
   this->CGI = &CGI;
   
-  unsigned Variant       = AsmWriter->getValueAsInt("Variant");
-  int FirstOperandColumn = AsmWriter->getValueAsInt("FirstOperandColumn");
-  int OperandSpacing     = AsmWriter->getValueAsInt("OperandSpacing");
-  
   unsigned CurVariant = ~0U;  // ~0 if we are outside a {.|.|.} region, other #.
   
   // This is the number of tabs we've seen if we're doing columnar layout.
@@ -88,9 +87,10 @@
                 unsigned DestColumn = FirstOperandColumn + 
                 CurColumn++ * OperandSpacing;
                 Operands.push_back(
-                                   AsmWriterOperand("O.PadToColumn(" +
-                                                    utostr(DestColumn) + ");\n",
-                                                    AsmWriterOperand::isLiteralStatementOperand));
+                  AsmWriterOperand(
+                    "O.PadToColumn(" +
+                    utostr(DestColumn) + ");\n",
+                    AsmWriterOperand::isLiteralStatementOperand));
               }
               break;
             case '"':
@@ -123,8 +123,8 @@
           unsigned DestColumn = FirstOperandColumn + 
           CurColumn++ * OperandSpacing;
           Operands.push_back(
-                             AsmWriterOperand("O.PadToColumn(" + utostr(DestColumn) + ");\n",
-                                              AsmWriterOperand::isLiteralStatementOperand));
+            AsmWriterOperand("O.PadToColumn(" + utostr(DestColumn) + ");\n",
+                             AsmWriterOperand::isLiteralStatementOperand));
           break;
         } else if (std::string("${|}\\").find(AsmString[DollarPos+1]) 
                    != std::string::npos) {
@@ -236,7 +236,7 @@
   }
   
   Operands.push_back(AsmWriterOperand("return;",
-                                      AsmWriterOperand::isLiteralStatementOperand));
+    AsmWriterOperand::isLiteralStatementOperand));
 }
 
 /// MatchesAllButOneOp - If this instruction is exactly identical to the
@@ -256,4 +256,4 @@
     }
   }
   return MismatchOperand;
-}
\ No newline at end of file
+}

Modified: llvm/trunk/utils/TableGen/AsmWriterInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterInst.h?rev=95715&r1=95714&r2=95715&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterInst.h (original)
+++ llvm/trunk/utils/TableGen/AsmWriterInst.h Tue Feb  9 17:06:35 2010
@@ -81,7 +81,10 @@
     std::vector<AsmWriterOperand> Operands;
     const CodeGenInstruction *CGI;
     
-    AsmWriterInst(const CodeGenInstruction &CGI, Record *AsmWriter);
+    AsmWriterInst(const CodeGenInstruction &CGI, 
+                  unsigned Variant,
+                  int FirstOperandColumn,
+                  int OperandSpacing);
     
     /// MatchesAllButOneOp - If this instruction is exactly identical to the
     /// specified instruction except for one differing operand, return the

Modified: llvm/trunk/utils/TableGen/EDEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/EDEmitter.cpp?rev=95715&r1=95714&r2=95715&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/EDEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/EDEmitter.cpp Tue Feb  9 17:06:35 2010
@@ -15,6 +15,7 @@
 
 #include "EDEmitter.h"
 
+#include "AsmWriterInst.h"
 #include "CodeGenTarget.h"
 #include "Record.h"
 





More information about the llvm-commits mailing list