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.

llvm-svn: 211485

clang/lib/Parse/ParseStmtAsm.cpp

index bad8a4e..6f16614 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;