diff options
-rw-r--r-- | clang/include/clang/Basic/TargetInfo.h | 3 | ||||
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h index 5b6d745f154..76006d4292e 100644 --- a/clang/include/clang/Basic/TargetInfo.h +++ b/clang/include/clang/Basic/TargetInfo.h @@ -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') diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 82f5df1cf1f..dd167dca47b 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -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: |