summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterClassInfo.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-02 22:22:43 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-02 22:22:43 +0000
commite242ebea50d473440c6330924bc3d4d79dc78760 (patch)
treecb07467aa88b8eb9282e5667ee7a4146e0e8326e /llvm/lib/CodeGen/RegisterClassInfo.cpp
parentdd0e5a525800c22703ef70a6a1688269dd6e8ccd (diff)
downloadbcm5719-llvm-e242ebea50d473440c6330924bc3d4d79dc78760.tar.gz
bcm5719-llvm-e242ebea50d473440c6330924bc3d4d79dc78760.zip
Just use a SmallVector.
I was confused whether new uint8_t[] would zero-initialize the returned array, and it seems that so is gcc-4.0. This should fix the test failures on darwin 9. llvm-svn: 132500
Diffstat (limited to 'llvm/lib/CodeGen/RegisterClassInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterClassInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterClassInfo.cpp b/llvm/lib/CodeGen/RegisterClassInfo.cpp
index 2d56ec3341b..9b106815ef0 100644
--- a/llvm/lib/CodeGen/RegisterClassInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -39,7 +39,8 @@ void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
if (Update || CSR != CalleeSaved) {
// Build a CSRNum map. Every CSR alias gets an entry pointing to the last
// overlapping CSR.
- CSRNum.reset(new uint8_t[TRI->getNumRegs()]());
+ CSRNum.clear();
+ CSRNum.resize(TRI->getNumRegs(), 0);
for (unsigned N = 0; unsigned Reg = CSR[N]; ++N)
for (const unsigned *AS = TRI->getOverlaps(Reg);
unsigned Alias = *AS; ++AS)
OpenPOWER on IntegriCloud