From 6edf90b8a7168e53409d161fb8b285094c4c9182 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 2 Jun 2011 22:22:43 +0000 Subject: [PATCH] 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 --- lib/CodeGen/RegisterClassInfo.cpp | 3 ++- lib/CodeGen/RegisterClassInfo.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/RegisterClassInfo.cpp b/lib/CodeGen/RegisterClassInfo.cpp index 2d56ec3341b..9b106815ef0 100644 --- a/lib/CodeGen/RegisterClassInfo.cpp +++ b/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/lib/CodeGen/RegisterClassInfo.h b/lib/CodeGen/RegisterClassInfo.h index 1ac040833ba..e41ae9e8dab 100644 --- a/lib/CodeGen/RegisterClassInfo.h +++ b/lib/CodeGen/RegisterClassInfo.h @@ -51,7 +51,7 @@ class RegisterClassInfo { const unsigned *CalleeSaved; // Map register number to CalleeSaved index + 1; - OwningArrayPtr CSRNum; + SmallVector CSRNum; // Reserved registers in the current MF. BitVector Reserved;