]> granicus.if.org Git - clang/commitdiff
in a tied operand, don't copy over the name or constraint string, just the flags.
authorChris Lattner <sabre@nondot.org>
Sun, 26 Apr 2009 18:05:25 +0000 (18:05 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Apr 2009 18:05:25 +0000 (18:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70137 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TargetInfo.h
lib/Basic/TargetInfo.cpp
lib/Sema/SemaStmt.cpp

index acd64f3dbc09bcdf79ed83aec116acb80b61e142..eda49ef197d4cd6e34e9e00a6f1aaca421bbfee5 100644 (file)
@@ -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
index a7241f28642a81815e045fdf1ef8d329794dc31f..d1e351077e2d1c8e641ab0eeb77bbf8a5b0add21 100644 (file)
@@ -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
index 13d24c36a00367e7cec5355c97ffc0c10b824105..ad33ad3b209490e2562b886d374a8b099157f8c6 100644 (file)
@@ -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())