]> granicus.if.org Git - clang/commitdiff
[ms-inline asm] Simplify logic. No functional change intended.
authorChad Rosier <mcrosier@apple.com>
Wed, 22 Aug 2012 20:57:07 +0000 (20:57 +0000)
committerChad Rosier <mcrosier@apple.com>
Wed, 22 Aug 2012 20:57:07 +0000 (20:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162392 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmtAsm.cpp

index f5852ae45ce44e2b6f28fe454257bdbc06bbf434..e5f78f5e64ba739a036de152e9f82155c66f01c6 100644 (file)
@@ -450,17 +450,12 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
     return Owned(NS);
   }
 
-  unsigned NumAsmStrings;
   std::vector<std::string> AsmStrings;
   std::vector<std::pair<unsigned,unsigned> > AsmTokRanges;
   std::string AsmString = buildMSAsmString(*this, AsmToks, AsmStrings, AsmTokRanges);
-  NumAsmStrings = AsmStrings.size();
 
-  std::vector<std::vector<StringRef> > Pieces;
-  Pieces.resize(NumAsmStrings);
-
-
-  for (unsigned i = 0; i != NumAsmStrings; ++i)
+  std::vector<std::vector<StringRef> > Pieces(AsmStrings.size());
+  for (unsigned i = 0, e = AsmStrings.size(); i != e; ++i)
     buildMSAsmPieces(AsmStrings[i], Pieces[i]);
 
   bool IsSimple = isSimpleMSAsm(Pieces, Context.getTargetInfo());