]> granicus.if.org Git - clang/commitdiff
Change handling of inline asm 'p' constraint to match llvm-gcc.
authorDale Johannesen <dalej@apple.com>
Fri, 22 Oct 2010 21:07:10 +0000 (21:07 +0000)
committerDale Johannesen <dalej@apple.com>
Fri, 22 Oct 2010 21:07:10 +0000 (21:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117149 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TargetInfo.h
lib/Basic/Targets.cpp

index 99f5bd86288c4c593532cedde13b38b6c17db440..a00cc0d07c1284003edf92414cc1b783b47a5e8b 100644 (file)
@@ -356,6 +356,9 @@ public:
                            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);
   }
 
index b58f067e2ba8cc0f9aa167a92f6966fa9c063920..9afef32f05f97177cdc7a10281072011f933abac 100644 (file)
@@ -1315,6 +1315,8 @@ X86TargetInfo::convertConstraint(const char Constraint) const {
   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.