aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-26 18:05:25 +0000
committerChris Lattner <sabre@nondot.org>2009-04-26 18:05:25 +0000
commitd68876176a0d2c19e3864e7d38f6036c4f72f0a3 (patch)
treebb3460f556c6d1976932b8c6e0de39db8864eb7b
parent2819fa85651526d59ade4fdc9da2cadd7b132973 (diff)
in a tied operand, don't copy over the name or constraint string, just the flags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70137 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/TargetInfo.h10
-rw-r--r--lib/Basic/TargetInfo.cpp3
-rw-r--r--lib/Sema/SemaStmt.cpp1
3 files changed, 10 insertions, 4 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index acd64f3dbc..eda49ef197 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -231,7 +231,15 @@ public:
void setIsReadWrite() { Flags |= CI_ReadWrite; }
void setAllowsMemory() { Flags |= CI_AllowsMemory; }
void setAllowsRegister() { Flags |= CI_AllowsRegister; }
- void setTiedOperand(unsigned N) { TiedOperand = N; }
+
+ /// setTiedOperand - Indicate that this is an input operand that is tied to
+ /// the specified output operand. Copy over the various constraint
+ /// information from the output.
+ void setTiedOperand(unsigned N, ConstraintInfo &Output) {
+ Flags = Output.Flags;
+ TiedOperand = N;
+ // Don't copy Name or constraint string.
+ }
};
// validateOutputConstraint, validateInputConstraint - Checks that
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp
index a7241f2864..d1e351077e 100644
--- a/lib/Basic/TargetInfo.cpp
+++ b/lib/Basic/TargetInfo.cpp
@@ -245,8 +245,7 @@ bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints,
// The constraint should have the same info as the respective
// output constraint.
- Info = OutputConstraints[i];
- Info.setTiedOperand(i);
+ Info.setTiedOperand(i, 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
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 13d24c36a0..ad33ad3b20 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -915,7 +915,6 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
return StmtError(Diag(AsmString->getLocStart(),diag::err_asm_wide_character)
<< AsmString->getSourceRange());
-
for (unsigned i = 0; i != NumOutputs; i++) {
StringLiteral *Literal = Constraints[i];
if (Literal->isWide())