[llvm] r241821 - [StackMaps] Use emplace_back when possible. NFC.

Juergen Ributzka juergen at apple.com
Thu Jul 9 10:11:08 PDT 2015


Author: ributzka
Date: Thu Jul  9 12:11:08 2015
New Revision: 241821

URL: http://llvm.org/viewvc/llvm-project?rev=241821&view=rev
Log:
[StackMaps] Use emplace_back when possible. NFC.

Modified:
    llvm/trunk/lib/CodeGen/StackMaps.cpp

Modified: llvm/trunk/lib/CodeGen/StackMaps.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackMaps.cpp?rev=241821&r1=241820&r2=241821&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackMaps.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackMaps.cpp Thu Jul  9 12:11:08 2015
@@ -99,8 +99,8 @@ StackMaps::parseOperand(MachineInstr::co
       Size /= 8;
       unsigned Reg = (++MOI)->getReg();
       int64_t Imm = (++MOI)->getImm();
-      Locs.push_back(Location(StackMaps::Location::Direct, Size,
-                              getDwarfRegNum(Reg, TRI), Imm));
+      Locs.emplace_back(StackMaps::Location::Direct, Size,
+                        getDwarfRegNum(Reg, TRI), Imm);
       break;
     }
     case StackMaps::IndirectMemRefOp: {
@@ -108,15 +108,15 @@ StackMaps::parseOperand(MachineInstr::co
       assert(Size > 0 && "Need a valid size for indirect memory locations.");
       unsigned Reg = (++MOI)->getReg();
       int64_t Imm = (++MOI)->getImm();
-      Locs.push_back(Location(StackMaps::Location::Indirect, Size,
-                              getDwarfRegNum(Reg, TRI), Imm));
+      Locs.emplace_back(StackMaps::Location::Indirect, Size,
+                        getDwarfRegNum(Reg, TRI), Imm);
       break;
     }
     case StackMaps::ConstantOp: {
       ++MOI;
       assert(MOI->isImm() && "Expected constant operand.");
       int64_t Imm = MOI->getImm();
-      Locs.push_back(Location(Location::Constant, sizeof(int64_t), 0, Imm));
+      Locs.emplace_back(Location::Constant, sizeof(int64_t), 0, Imm);
       break;
     }
     }





More information about the llvm-commits mailing list