[cfe-commits] r132752 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp
Stuart Hastings
stuart at apple.com
Wed Jun 8 09:06:31 PDT 2011
Author: stuart
Date: Wed Jun 8 11:06:31 2011
New Revision: 132752
URL: http://llvm.org/viewvc/llvm-project?rev=132752&view=rev
Log:
Followup to 132737; make two-character string explicit, add some
comments. rdar://problem/9037836
Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=132752&r1=132751&r2=132752&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Wed Jun 8 11:06:31 2011
@@ -368,6 +368,9 @@
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')
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=132752&r1=132751&r2=132752&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jun 8 11:06:31 2011
@@ -2054,7 +2054,7 @@
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:
More information about the cfe-commits
mailing list