r211485 - Parse: Simplify construction of the clobber list

David Majnemer david.majnemer at gmail.com
Sun Jun 22 19:16:41 PDT 2014


Author: majnemer
Date: Sun Jun 22 21:16:41 2014
New Revision: 211485

URL: http://llvm.org/viewvc/llvm-project?rev=211485&view=rev
Log:
Parse: Simplify construction of the clobber list

This avoids going over the clobber list twice.

No functionality change.

Modified:
    cfe/trunk/lib/Parse/ParseStmtAsm.cpp

Modified: cfe/trunk/lib/Parse/ParseStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmtAsm.cpp?rev=211485&r1=211484&r2=211485&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmtAsm.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmtAsm.cpp Sun Jun 22 21:16:41 2014
@@ -502,10 +502,7 @@ StmtResult Parser::ParseMicrosoftAsmStat
   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;





More information about the cfe-commits mailing list