From d68876176a0d2c19e3864e7d38f6036c4f72f0a3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Apr 2009 18:05:25 +0000 Subject: [PATCH] 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 --- include/clang/Basic/TargetInfo.h | 10 +++++++++- lib/Basic/TargetInfo.cpp | 3 +-- lib/Sema/SemaStmt.cpp | 1 - 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()) -- 2.40.0