[cfe-commits] r162392 - /cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Chad Rosier mcrosier at apple.com
Wed Aug 22 13:57:07 PDT 2012


Author: mcrosier
Date: Wed Aug 22 15:57:07 2012
New Revision: 162392

URL: http://llvm.org/viewvc/llvm-project?rev=162392&view=rev
Log:
[ms-inline asm] Simplify logic.  No functional change intended.

Modified:
    cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=162392&r1=162391&r2=162392&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Wed Aug 22 15:57:07 2012
@@ -450,17 +450,12 @@
     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());





More information about the cfe-commits mailing list