[llvm-commits] [llvm] r95759 - in /llvm/trunk/utils/TableGen: AsmWriterInst.cpp AsmWriterInst.h

Sean Callanan scallanan at apple.com
Tue Feb 9 18:27:43 PST 2010


Author: spyffe
Date: Tue Feb  9 20:27:43 2010
New Revision: 95759

URL: http://llvm.org/viewvc/llvm-project?rev=95759&view=rev
Log:
Changed AsmWriterOperand to also include the index of the
operand into the CodeGenInstruction's list of operands,
which is useful for EDEmitter.  (Still working on PR6219)

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

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

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterInst.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterInst.cpp Tue Feb  9 20:27:43 2010
@@ -219,7 +219,10 @@
       
       if (VarName.empty()) {
         // Just a modifier, pass this into PrintSpecial.
-        Operands.push_back(AsmWriterOperand("PrintSpecial", ~0U, Modifier));
+        Operands.push_back(AsmWriterOperand("PrintSpecial", 
+                                            ~0U, 
+                                            ~0U, 
+                                            Modifier));
       } else {
         // Otherwise, normal operand.
         unsigned OpNo = CGI.getOperandNamed(VarName);
@@ -227,7 +230,9 @@
         
         if (CurVariant == Variant || CurVariant == ~0U) {
           unsigned MIOp = OpInfo.MIOperandNo;
-          Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, MIOp,
+          Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, 
+                                              OpNo,
+                                              MIOp,
                                               Modifier));
         }
       }

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

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterInst.h (original)
+++ llvm/trunk/utils/TableGen/AsmWriterInst.h Tue Feb  9 20:27:43 2010
@@ -41,6 +41,10 @@
     /// into the asm writer.
     std::string Str;
     
+    /// CGIOpNo - For isMachineInstrOperand, this is the index of the operand in
+    /// the CodeGenInstruction.
+    unsigned CGIOpNo;
+    
     /// MiOpNo - For isMachineInstrOperand, this is the operand number of the
     /// machine instruction.
     unsigned MIOpNo;
@@ -56,10 +60,12 @@
                      OpType op = isLiteralTextOperand)
     : OperandType(op), Str(LitStr) {}
     
-    AsmWriterOperand(const std::string &Printer, unsigned OpNo, 
+    AsmWriterOperand(const std::string &Printer,
+                     unsigned _CGIOpNo,
+                     unsigned _MIOpNo,
                      const std::string &Modifier,
                      OpType op = isMachineInstrOperand) 
-    : OperandType(op), Str(Printer), MIOpNo(OpNo),
+    : OperandType(op), Str(Printer), CGIOpNo(_CGIOpNo), MIOpNo(_MIOpNo),
     MiModifier(Modifier) {}
     
     bool operator!=(const AsmWriterOperand &Other) const {





More information about the llvm-commits mailing list