]> granicus.if.org Git - clang/commitdiff
[ms-inline asm] Rename a few induction variables to avoid confusion and silence
authorChad Rosier <mcrosier@apple.com>
Thu, 23 Aug 2012 15:44:35 +0000 (15:44 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 23 Aug 2012 15:44:35 +0000 (15:44 +0000)
a gcc warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162444 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmtAsm.cpp

index 1293b7daefbfa52c769c9b0d4f0f6e8f9ea42c81..874ab545e77d7dc50196c62d3162275ca6e06c68 100644 (file)
@@ -506,11 +506,11 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
   OwningPtr<llvm::MCSubtargetInfo>
     STI(TheTarget->createMCSubtargetInfo(TT, "", ""));
 
-  for (unsigned i = 0, e = AsmStrings.size(); i != e; ++i) {
+  for (unsigned StrIdx = 0, e = AsmStrings.size(); StrIdx != e; ++StrIdx) {
     llvm::SourceMgr SrcMgr;
     llvm::MCContext Ctx(*MAI, *MRI, MOFI.get(), &SrcMgr);
     llvm::MemoryBuffer *Buffer =
-      llvm::MemoryBuffer::getMemBuffer(AsmStrings[i], "<inline asm>");
+      llvm::MemoryBuffer::getMemBuffer(AsmStrings[StrIdx], "<inline asm>");
 
     // Tell SrcMgr about this buffer, which is what the parser will pick up.
     SrcMgr.AddNewSourceBuffer(Buffer, llvm::SMLoc());
@@ -562,14 +562,14 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
 
     // Build the list of clobbers, outputs and inputs.
     unsigned NumDefs = Desc.getNumDefs();
-    for (unsigned j = 0, e = Inst.getNumOperands(); j != e; ++j) {
-      const llvm::MCOperand &Op = Inst.getOperand(j);
+    for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i) {
+      const llvm::MCOperand &Op = Inst.getOperand(i);
 
       // Immediate.
       if (Op.isImm() || Op.isFPImm())
         continue;
 
-      bool isDef = NumDefs && (j < NumDefs);
+      bool isDef = NumDefs && (i < NumDefs);
 
       // Register/Clobber.
       if (Op.isReg() && isDef) {
@@ -591,8 +591,8 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
         if ((SymRef = dyn_cast<llvm::MCSymbolRefExpr>(Expr))) {
           StringRef Name = SymRef->getSymbol().getName();
           IdentifierInfo *II = getIdentifierInfo(Name, AsmToks,
-                                                 AsmTokRanges[i].first,
-                                                 AsmTokRanges[i].second);
+                                                 AsmTokRanges[StrIdx].first,
+                                                 AsmTokRanges[StrIdx].second);
           if (II)
             isDef ? Outputs.push_back(II) : Inputs.push_back(II);
         }