diff options
author | Stuart Hastings <stuart@apple.com> | 2011-06-08 16:06:31 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2011-06-08 16:06:31 +0000 |
commit | 6ce33d67e2ed4f8c9395a807bebd25be04580c0f (patch) | |
tree | 866b80bb05eb931473ea7d1919c76037360059c4 | |
parent | af9cddfda10802f948e9d4b44ebded1ec749de21 (diff) |
Followup to 132737; make two-character string explicit, add some
comments. rdar://problem/9037836
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132752 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 3 | ||||
-rw-r--r-- | lib/Basic/Targets.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 5b6d745f15..76006d4292 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/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/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 82f5df1cf1..dd167dca47 100644 --- a/lib/Basic/Targets.cpp +++ b/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: |