[cfe-commits] r70669 - /cfe/trunk/include/clang/Basic/TargetInfo.h

Chris Lattner sabre at nondot.org
Sat May 2 23:59:38 PDT 2009


Author: lattner
Date: Sun May  3 01:59:37 2009
New Revision: 70669

URL: http://llvm.org/viewvc/llvm-project?rev=70669&view=rev
Log:
add a flag to output asm constraints so that we efficiently know
if there is an input constraint that is tied to it.

Modified:
    cfe/trunk/include/clang/Basic/TargetInfo.h

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=70669&r1=70668&r2=70669&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sun May  3 01:59:37 2009
@@ -204,7 +204,8 @@
       CI_None = 0x00,
       CI_AllowsMemory = 0x01,
       CI_AllowsRegister = 0x02,
-      CI_ReadWrite = 0x04   // "+r" output constraint (read and write).
+      CI_ReadWrite = 0x04,       // "+r" output constraint (read and write).
+      CI_HasMatchingInput = 0x08 // This output operand has a matching input.
     };
     unsigned Flags;
     int TiedOperand;
@@ -222,6 +223,14 @@
     bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; }
     bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; }
     bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; }
+    
+    /// hasMatchingInput - Return true if this output operand has a matching
+    /// (tied) input operand.
+    bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; }
+    
+    /// hasTiedOperand() - Return true if this input operand is a matching
+    /// constraint that ties it to an output operand.  If this returns true,
+    /// then getTiedOperand will indicate which output operand this is tied to.
     bool hasTiedOperand() const { return TiedOperand != -1; }
     unsigned getTiedOperand() const {
       assert(hasTiedOperand() && "Has no tied operand!");
@@ -231,11 +240,13 @@
     void setIsReadWrite() { Flags |= CI_ReadWrite; }
     void setAllowsMemory() { Flags |= CI_AllowsMemory; }
     void setAllowsRegister() { Flags |= CI_AllowsRegister; }
+    void setHasMatchingInput() { Flags |= CI_HasMatchingInput; }
     
     /// setTiedOperand - Indicate that this is an input operand that is tied to
     /// the specified output operand.  Copy over the various constraint
     /// information from the output.
     void setTiedOperand(unsigned N, ConstraintInfo &Output) {
+      Output.setHasMatchingInput();
       Flags = Output.Flags;
       TiedOperand = N;
       // Don't copy Name or constraint string.





More information about the cfe-commits mailing list