aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2010-08-10 19:20:14 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2010-08-10 19:20:14 +0000
commitef44e1110711276ffffe4b22d4ba0cebd49cb330 (patch)
treeb3cc4f9758724424ba577fd1260b3ae9b8b6ff54 /lib/CodeGen/CGStmt.cpp
parent224124c7b85596157201a67a7ba12d2b0f5c153c (diff)
Slightly revised handling of mult-alt constraints, to avoid an assert, until we have the full fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 3bbecfa59c..6dad8597a8 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -861,16 +861,24 @@ static std::string
SimplifyConstraint(const char *Constraint, const TargetInfo &Target,
llvm::SmallVectorImpl<TargetInfo::ConstraintInfo> *OutCons=0) {
std::string Result;
+ std::string tmp;
while (*Constraint) {
switch (*Constraint) {
default:
- Result += Target.convertConstraint(*Constraint);
+ tmp = Target.convertConstraint(*Constraint);
+ if (Result.find(tmp) == std::string::npos) // Combine unique constraints
+ Result += tmp;
break;
// Ignore these
case '*':
case '?':
case '!':
+ case '=': // Will see this and the following in mult-alt constraints.
+ case '+':
+ break;
+ case ',': // FIXME - Until the back-end properly supports
+ return Result; // multiple alternative constraints, we stop here.
break;
case 'g':
Result += "imr";