llvm.org GIT mirror llvm / 20d7da5
CodeGen/LiveVariables: switch to std::vector No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216367 91177308-0d34-0410-b5e6-96231b3b80d8 Dylan Noblesmith 6 years ago
2 changed file(s) with 17 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
133133 // PhysRegInfo - Keep track of which instruction was the last def of a
134134 // physical register. This is a purely local property, because all physical
135135 // register references are presumed dead across basic blocks.
136 MachineInstr **PhysRegDef;
136 std::vector PhysRegDef;
137137
138138 // PhysRegInfo - Keep track of which instruction was the last use of a
139139 // physical register. This is a purely local property, because all physical
140140 // register references are presumed dead across basic blocks.
141 MachineInstr **PhysRegUse;
142
143 SmallVector *PHIVarInfo;
141 std::vector PhysRegUse;
142
143 std::vector> PHIVarInfo;
144144
145145 // DistanceMap - Keep track the distance of a MI from the start of the
146146 // current basic block.
501501 MRI = &mf.getRegInfo();
502502 TRI = MF->getSubtarget().getRegisterInfo();
503503
504 unsigned NumRegs = TRI->getNumRegs();
505 PhysRegDef = new MachineInstr*[NumRegs];
506 PhysRegUse = new MachineInstr*[NumRegs];
507 PHIVarInfo = new SmallVector[MF->getNumBlockIDs()];
508 std::fill(PhysRegDef, PhysRegDef + NumRegs, nullptr);
509 std::fill(PhysRegUse, PhysRegUse + NumRegs, nullptr);
504 const unsigned NumRegs = TRI->getNumRegs();
505 PhysRegDef.clear();
506 PhysRegUse.clear();
507 PhysRegDef.resize(NumRegs, nullptr);
508 PhysRegUse.resize(NumRegs, nullptr);
509 PHIVarInfo.resize(MF->getNumBlockIDs());
510510 PHIJoins.clear();
511511
512512 // FIXME: LiveIntervals will be updated to remove its dependence on
636636 if ((PhysRegDef[i] || PhysRegUse[i]) && !LiveOuts.count(i))
637637 HandlePhysRegDef(i, nullptr, Defs);
638638
639 std::fill(PhysRegDef, PhysRegDef + NumRegs, nullptr);
640 std::fill(PhysRegUse, PhysRegUse + NumRegs, nullptr);
639 PhysRegDef.clear();
640 PhysRegUse.clear();
641 PhysRegDef.resize(NumRegs, nullptr);
642 PhysRegUse.resize(NumRegs, nullptr);
641643 }
642644
643645 // Convert and transfer the dead / killed information we have gathered into
659661 assert(Visited.count(&*i) != 0 && "unreachable basic block found");
660662 #endif
661663
662 delete[] PhysRegDef;
663 delete[] PhysRegUse;
664 delete[] PHIVarInfo;
664 PhysRegDef.clear();
665 PhysRegUse.clear();
666 PHIVarInfo.clear();
665667
666668 return false;
667669 }