[cfe-commits] r163143 - /cfe/trunk/lib/AST/Stmt.cpp

Chad Rosier mcrosier at apple.com
Tue Sep 4 09:36:26 PDT 2012


Author: mcrosier
Date: Tue Sep  4 11:36:26 2012
New Revision: 163143

URL: http://llvm.org/viewvc/llvm-project?rev=163143&view=rev
Log:
[ms-inline asm] Fix an illegal index and an 80-column violation.

Modified:
    cfe/trunk/lib/AST/Stmt.cpp

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=163143&r1=163142&r2=163143&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Tue Sep  4 11:36:26 2012
@@ -678,9 +678,9 @@
                      ArrayRef<Expr*> inputexprs, ArrayRef<Expr*> outputexprs,
                      StringRef asmstr, ArrayRef<StringRef> constraints,
                      ArrayRef<StringRef> clobbers, SourceLocation endloc)
-  : AsmStmt(MSAsmStmtClass, asmloc, issimple, isvolatile, outputs.size(), inputs.size(),
-            clobbers.size()), LBraceLoc(lbraceloc), EndLoc(endloc),
-    AsmStr(asmstr.str()), NumAsmToks(asmtoks.size()) {
+  : AsmStmt(MSAsmStmtClass, asmloc, issimple, isvolatile, outputs.size(),
+            inputs.size(), clobbers.size()), LBraceLoc(lbraceloc),
+            EndLoc(endloc), AsmStr(asmstr.str()), NumAsmToks(asmtoks.size()) {
   assert (inputs.size() == inputexprs.size() && "Input expr size mismatch!");
   assert (outputs.size() == outputexprs.size() && "Input expr size mismatch!");
 
@@ -689,14 +689,14 @@
   Names = new (C) IdentifierInfo*[NumExprs];
   for (unsigned i = 0, e = NumOutputs; i != e; ++i)
     Names[i] = outputs[i];
-  for (unsigned i = NumOutputs, e = NumExprs; i != e; ++i)
-    Names[i] = inputs[i];
+  for (unsigned i = NumOutputs, j = 0, e = NumExprs; i != e; ++i, ++j)
+    Names[i] = inputs[j];
 
   Exprs = new (C) Stmt*[NumExprs];
   for (unsigned i = 0, e = NumOutputs; i != e; ++i)
     Exprs[i] = outputexprs[i];
-  for (unsigned i = NumOutputs, e = NumExprs; i != e; ++i)
-    Exprs[i] = inputexprs[i];
+  for (unsigned i = NumOutputs, j = 0, e = NumExprs; i != e; ++i, ++j)
+    Exprs[i] = inputexprs[j];
 
   AsmToks = new (C) Token[NumAsmToks];
   for (unsigned i = 0, e = NumAsmToks; i != e; ++i)





More information about the cfe-commits mailing list