]> granicus.if.org Git - clang/commitdiff
[ms-inline asm] isDef/NumDefs in this context only refer to register definitions...
authorChad Rosier <mcrosier@apple.com>
Tue, 11 Sep 2012 23:53:48 +0000 (23:53 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 11 Sep 2012 23:53:48 +0000 (23:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163666 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmtAsm.cpp

index 2d20d6afcc56bc8fe7bb6453ea31742b23ffd79f..3f57a6ec035b45eeb2ba85443a07741998668346 100644 (file)
@@ -595,10 +595,9 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
       }
 
       const llvm::MCOperand &Op = Inst.getOperand(MCIdx);
-      bool isDef = NumDefs && (MCIdx < NumDefs);
 
       // Register/Clobber.
-      if (Op.isReg() && isDef) {
+      if (Op.isReg() && NumDefs && (MCIdx < NumDefs)) {
         std::string Reg;
         llvm::raw_string_ostream OS(Reg);
         IP->printRegName(OS, Op.getReg());
@@ -628,7 +627,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
                                                   false, false);
             if (!Result.isInvalid()) {
               bool isMemDef = (i == 1) && Desc.mayStore();
-              if (isDef || isMemDef) {
+              if (isMemDef) {
                 Outputs.push_back(II);
                 OutputExprs.push_back(Result.take());
                 OutputExprNames.push_back(Name.str());