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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2011-06-02 22:22:43 +00:00
parent effc34ec59
commit 6edf90b8a7
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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;