]> granicus.if.org Git - clang/commitdiff
Followup to 132737; make two-character string explicit, add some
authorStuart Hastings <stuart@apple.com>
Wed, 8 Jun 2011 16:06:31 +0000 (16:06 +0000)
committerStuart Hastings <stuart@apple.com>
Wed, 8 Jun 2011 16:06:31 +0000 (16:06 +0000)
comments.  rdar://problem/9037836

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132752 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 5b6d745f154f3d53ba13fa0a10aca0cb8dea3bfc..76006d4292e819c3e38c322dc229067ba524130a 100644 (file)
@@ -368,6 +368,9 @@ public:
                            ConstraintInfo *OutputConstraints,
                            unsigned NumOutputs, unsigned &Index) const;
 
+  // Constraint parm will be left pointing at the last character of
+  // the constraint.  In practice, it won't be changed unless the
+  // constraint is longer than one character.
   virtual std::string convertConstraint(const char *&Constraint) const {
     // 'p' defaults to 'r', but can be overridden by targets.
     if (*Constraint == 'p')
index 82f5df1cf1f711b3486a2c851e8574c16061c7ce..dd167dca47b23b81da08220b83b401fec72c1fa2 100644 (file)
@@ -2054,7 +2054,7 @@ public:
     std::string R;
     switch (*Constraint) {
     case 'U':   // Two-character constraint; add "^" hint for later parsing.
-      R = std::string("^") + Constraint;
+      R = std::string("^") + std::string(Constraint, 2);
       Constraint++;
       break;
     default: