From e242ebea50d473440c6330924bc3d4d79dc78760 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 2 Jun 2011 22:22:43 +0000 Subject: 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 --- llvm/lib/CodeGen/RegisterClassInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/RegisterClassInfo.cpp') 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) -- cgit v1.2.3