[cfe-commits] r117149 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp

Dale Johannesen dalej at apple.com
Fri Oct 22 14:07:10 PDT 2010


Author: johannes
Date: Fri Oct 22 16:07:10 2010
New Revision: 117149

URL: http://llvm.org/viewvc/llvm-project?rev=117149&view=rev
Log:
Change handling of inline asm 'p' constraint to match llvm-gcc.


Modified:
    cfe/trunk/include/clang/Basic/TargetInfo.h
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=117149&r1=117148&r2=117149&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Fri Oct 22 16:07:10 2010
@@ -356,6 +356,9 @@
                            unsigned NumOutputs, unsigned &Index) const;
 
   virtual std::string convertConstraint(const char Constraint) const {
+    // 'p' defaults to 'r', but can be overridden by targets.
+    if (Constraint == 'p')
+      return std::string("r");
     return std::string(1, Constraint);
   }
 

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=117149&r1=117148&r2=117149&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Oct 22 16:07:10 2010
@@ -1315,6 +1315,8 @@
   case 'd': return std::string("{dx}");
   case 'S': return std::string("{si}");
   case 'D': return std::string("{di}");
+  case 'p': // address
+    return std::string("im");
   case 't': // top of floating point stack.
     return std::string("{st}");
   case 'u': // second from top of floating point stack.





More information about the cfe-commits mailing list