[llvm-commits] [llvm] r132500 - in /llvm/trunk/lib/CodeGen: RegisterClassInfo.cpp RegisterClassInfo.h
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Jun 2 15:22:43 PDT 2011
Author: stoklund
Date: Thu Jun 2 17:22:43 2011
New Revision: 132500
URL: http://llvm.org/viewvc/llvm-project?rev=132500&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp
llvm/trunk/lib/CodeGen/RegisterClassInfo.h
Modified: llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp?rev=132500&r1=132499&r2=132500&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp Thu Jun 2 17:22:43 2011
@@ -39,7 +39,8 @@
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)
Modified: llvm/trunk/lib/CodeGen/RegisterClassInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterClassInfo.h?rev=132500&r1=132499&r2=132500&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterClassInfo.h (original)
+++ llvm/trunk/lib/CodeGen/RegisterClassInfo.h Thu Jun 2 17:22:43 2011
@@ -51,7 +51,7 @@
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;
More information about the llvm-commits
mailing list