diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-06-02 22:22:43 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-06-02 22:22:43 +0000 |
| commit | e242ebea50d473440c6330924bc3d4d79dc78760 (patch) | |
| tree | cb07467aa88b8eb9282e5667ee7a4146e0e8326e /llvm | |
| parent | dd0e5a525800c22703ef70a6a1688269dd6e8ccd (diff) | |
| download | bcm5719-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')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterClassInfo.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegisterClassInfo.h | 2 |
2 files changed, 3 insertions, 2 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) diff --git a/llvm/lib/CodeGen/RegisterClassInfo.h b/llvm/lib/CodeGen/RegisterClassInfo.h index 1ac040833ba..e41ae9e8dab 100644 --- a/llvm/lib/CodeGen/RegisterClassInfo.h +++ b/llvm/lib/CodeGen/RegisterClassInfo.h @@ -51,7 +51,7 @@ class RegisterClassInfo { const unsigned *CalleeSaved; // Map register number to CalleeSaved index + 1; - OwningArrayPtr<uint8_t> CSRNum; + SmallVector<uint8_t, 4> CSRNum; // Reserved registers in the current MF. BitVector Reserved; |

