]> granicus.if.org Git - clang/commitdiff
Parse: Simplify construction of the clobber list
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 23 Jun 2014 02:16:41 +0000 (02:16 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 23 Jun 2014 02:16:41 +0000 (02:16 +0000)
This avoids going over the clobber list twice.

No functionality change.

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

lib/Parse/ParseStmtAsm.cpp

index bad8a4edd67b8a3d4941b3b17b0aa03bd3071ccd..6f166148b73afff77da5155e7418270b7272d7c9 100644 (file)
@@ -502,10 +502,7 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
   Clobbers.erase(End, Clobbers.end());
 
   // Build the vector of clobber StringRefs.
-  unsigned NumClobbers = Clobbers.size();
-  ClobberRefs.resize(NumClobbers);
-  for (unsigned i = 0; i != NumClobbers; ++i)
-    ClobberRefs[i] = StringRef(Clobbers[i]);
+  ClobberRefs.insert(ClobberRefs.end(), Clobbers.begin(), Clobbers.end());
 
   // Recast the void pointers and build the vector of constraint StringRefs.
   unsigned NumExprs = NumOutputs + NumInputs;