[llvm-commits] CVS: llvm/lib/VMCore/InlineAsm.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 23 15:37:05 PST 2006



Changes in directory llvm/lib/VMCore:

InlineAsm.cpp updated: 1.8 -> 1.9
---
Log message:

Parse the %*# constraint modifiers



---
Diffs of the changes:  (+11 -1)

 InlineAsm.cpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/InlineAsm.cpp
diff -u llvm/lib/VMCore/InlineAsm.cpp:1.8 llvm/lib/VMCore/InlineAsm.cpp:1.9
--- llvm/lib/VMCore/InlineAsm.cpp:1.8	Wed Feb  1 18:23:53 2006
+++ llvm/lib/VMCore/InlineAsm.cpp	Thu Feb 23 17:36:53 2006
@@ -51,6 +51,7 @@
   isEarlyClobber = false;
   isIndirectOutput = false;
   hasMatchingInput = false;
+  isCommutative = false;
   
   // Parse the prefix.
   if (*I == '~') {
@@ -74,12 +75,21 @@
     default:
       DoneWithModifiers = true;
       break;
-    case '&':
+    case '&':     // Early clobber.
       if (Type != isOutput ||      // Cannot early clobber anything but output.
           isEarlyClobber)          // Reject &&&&&&
         return true;
       isEarlyClobber = true;
       break;
+    case '%':     // Commutative.
+      if (Type == isClobber ||     // Cannot commute clobbers.
+          isCommutative)           // Reject %%%%%
+        return true;
+      isCommutative = true;
+      break;
+    case '#':     // Comment.
+    case '*':     // Register preferencing.
+      return true;     // Not supported.
     }
     
     if (!DoneWithModifiers) {






More information about the llvm-commits mailing list