summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/TargetInfo.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-01-27 20:38:24 +0000
committerAnders Carlsson <andersca@mac.com>2009-01-27 20:38:24 +0000
commit570c357ded427b55c35ddfe4b5ff73e221ea1305 (patch)
treec01f94f7cc74e40fd9ecbe8887a939a8ff5738da /clang/lib/Basic/TargetInfo.cpp
parent7415caa3d4269213f1849f5c0a3b80e10431c53c (diff)
downloadbcm5719-llvm-570c357ded427b55c35ddfe4b5ff73e221ea1305.tar.gz
bcm5719-llvm-570c357ded427b55c35ddfe4b5ff73e221ea1305.zip
If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417
llvm-svn: 63127
Diffstat (limited to 'clang/lib/Basic/TargetInfo.cpp')
-rw-r--r--clang/lib/Basic/TargetInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index 3ec3551ebb3..2b73582b786 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -222,6 +222,7 @@ bool TargetInfo::resolveSymbolicName(const char *&Name,
bool TargetInfo::validateInputConstraint(const char *Name,
const std::string *OutputNamesBegin,
const std::string *OutputNamesEnd,
+ ConstraintInfo* OutputConstraints,
ConstraintInfo &info) const {
info = CI_None;
@@ -236,6 +237,10 @@ bool TargetInfo::validateInputConstraint(const char *Name,
// Check if matching constraint is out of bounds.
if (i >= NumOutputs)
return false;
+
+ // The constraint should have the same info as the respective
+ // output constraint.
+ info = (ConstraintInfo)(info|OutputConstraints[i]);
} else if (!validateAsmConstraint(*Name, info)) {
// FIXME: This error return is in place temporarily so we can
// add more constraints as we hit it. Eventually, an unknown
OpenPOWER on IntegriCloud