mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-11 10:25:41 +00:00
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:
@@ -39,7 +39,8 @@ void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
|
|||||||
if (Update || CSR != CalleeSaved) {
|
if (Update || CSR != CalleeSaved) {
|
||||||
// Build a CSRNum map. Every CSR alias gets an entry pointing to the last
|
// Build a CSRNum map. Every CSR alias gets an entry pointing to the last
|
||||||
// overlapping CSR.
|
// 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 (unsigned N = 0; unsigned Reg = CSR[N]; ++N)
|
||||||
for (const unsigned *AS = TRI->getOverlaps(Reg);
|
for (const unsigned *AS = TRI->getOverlaps(Reg);
|
||||||
unsigned Alias = *AS; ++AS)
|
unsigned Alias = *AS; ++AS)
|
||||||
|
@@ -51,7 +51,7 @@ class RegisterClassInfo {
|
|||||||
const unsigned *CalleeSaved;
|
const unsigned *CalleeSaved;
|
||||||
|
|
||||||
// Map register number to CalleeSaved index + 1;
|
// Map register number to CalleeSaved index + 1;
|
||||||
OwningArrayPtr<uint8_t> CSRNum;
|
SmallVector<uint8_t, 4> CSRNum;
|
||||||
|
|
||||||
// Reserved registers in the current MF.
|
// Reserved registers in the current MF.
|
||||||
BitVector Reserved;
|
BitVector Reserved;
|
||||||
|
Reference in New Issue
Block a user