summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-07-15 05:56:32 +0000
committerBill Wendling <isanbard@gmail.com>2010-07-15 05:56:32 +0000
commitd5b390189dd3a514c0b01d764a9798cd531d2b59 (patch)
tree773bfddee3e7bf6a9393e9715baaffe3fb5490b9 /llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
parentceefcf0143af3167b12cdf1ad807e83dd55e71c8 (diff)
downloadbcm5719-llvm-d5b390189dd3a514c0b01d764a9798cd531d2b59.tar.gz
bcm5719-llvm-d5b390189dd3a514c0b01d764a9798cd531d2b59.zip
Use std::vector instead of a hard-coded array. The length of that array could
get *very* large, but we only need it to be the size of thenumber of pregs. llvm-svn: 108411
Diffstat (limited to 'llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp')
-rw-r--r--llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp b/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
index e3746a98564..9d486651ce0 100644
--- a/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
+++ b/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
@@ -34,6 +34,9 @@ CriticalAntiDepBreaker(MachineFunction& MFi) :
TRI(MF.getTarget().getRegisterInfo()),
AllocatableSet(TRI->getAllocatableSet(MF))
{
+ Classes.reserve(TRI->getNumRegs());
+ KillIndices.reserve(TRI->getNumRegs());
+ DefIndices.reserve(TRI->getNumRegs());
}
CriticalAntiDepBreaker::~CriticalAntiDepBreaker() {
@@ -41,8 +44,7 @@ CriticalAntiDepBreaker::~CriticalAntiDepBreaker() {
void CriticalAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
// Clear out the register class data.
- std::fill(Classes, array_endof(Classes),
- static_cast<const TargetRegisterClass *>(0));
+ Classes.clear();
// Initialize the indices to indicate that no registers are live.
const unsigned BBSize = BB->size();
OpenPOWER on IntegriCloud