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 | 5b7b11cedb1d3c70cf201f564c91b76c9fb9e3bb (patch) | |
tree | ee15dee8d08f4410ed2ac2ebad54bd6ea4fae9f8 | |
parent | 6ed0c635592c11abe6393ce18fc74e67b3fa0a35 (diff) | |
download | bcm5719-llvm-5b7b11cedb1d3c70cf201f564c91b76c9fb9e3bb.tar.gz bcm5719-llvm-5b7b11cedb1d3c70cf201f564c91b76c9fb9e3bb.zip |
Followup to 132737; make two-character string explicit, add some
comments. rdar://problem/9037836
llvm-svn: 132752
-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: |