diff options
author | Dylan Noblesmith <nobled@dreamwidth.org> | 2014-08-26 02:03:25 +0000 |
---|---|---|
committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2014-08-26 02:03:25 +0000 |
commit | 71499d3a5dc86ee08755f45b12c057f9d08834ba (patch) | |
tree | 540a82570faf5043c78d5e91ba89f4e9d6225d57 /lib/CodeGen/LiveVariables.cpp | |
parent | fad8d818dbd9784f58b04c0790435620226e0450 (diff) |
CodeGen/LiveVariables: use vector::assign()
Address review comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index d91c9300d3b..f9040fd6486 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -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 |