CodeGen/LiveVariables: use vector::assign()
authorDylan Noblesmith <nobled@dreamwidth.org>
Tue, 26 Aug 2014 02:03:25 +0000 (02:03 +0000)
committerDylan Noblesmith <nobled@dreamwidth.org>
Tue, 26 Aug 2014 02:03:25 +0000 (02:03 +0000)
Address review comments.

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

lib/CodeGen/LiveVariables.cpp

index d91c9300d3b1f11b1da37bb4acbcc9cfa96131f2..f9040fd64867bc65be767b5d186a2a9951e91c42 100644 (file)
@@ -623,10 +623,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
   TRI = MF->getSubtarget().getRegisterInfo();
 
   const unsigned NumRegs = TRI->getNumRegs();
-  PhysRegDef.clear();
-  PhysRegUse.clear();
-  PhysRegDef.resize(NumRegs, nullptr);
-  PhysRegUse.resize(NumRegs, nullptr);
+  PhysRegDef.assign(NumRegs, nullptr);
+  PhysRegUse.assign(NumRegs, nullptr);
   PHIVarInfo.resize(MF->getNumBlockIDs());
   PHIJoins.clear();
 
@@ -648,10 +646,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
   for (MachineBasicBlock *MBB : depth_first_ext(Entry, Visited)) {
     runOnBlock(MBB, NumRegs);
 
-    PhysRegDef.clear();
-    PhysRegUse.clear();
-    PhysRegDef.resize(NumRegs, nullptr);
-    PhysRegUse.resize(NumRegs, nullptr);
+    PhysRegDef.assign(NumRegs, nullptr);
+    PhysRegUse.assign(NumRegs, nullptr);
   }
 
   // Convert and transfer the dead / killed information we have gathered into