Convert RegClass::IsColorUsedArr from a dynamically allocated array to

a vector.  This makes asserting on array bounds easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-05-23 15:50:03 +00:00
parent 195755ced7
commit 85c5465e07
10 changed files with 90 additions and 106 deletions

View File

@@ -14,7 +14,7 @@ RegClass::RegClass(const Function *M,
if( DEBUG_RA)
cerr << "Created Reg Class: " << RegClassID << "\n";
IsColorUsedArr = new bool[ Mrc->getNumOfAllRegs() ];
IsColorUsedArr.resize(Mrc->getNumOfAllRegs());
}
@@ -200,14 +200,13 @@ void RegClass::colorIGNode(IGNode *const Node)
// init all elements of to IsColorUsedAr false;
//
for( unsigned i=0; i < MRC->getNumOfAllRegs(); i++) {
IsColorUsedArr[ i ] = false;
}
for (unsigned i=0; i < MRC->getNumOfAllRegs(); i++)
IsColorUsedArr[i] = false;
// init all reserved_regs to true - we can't use them
//
for( unsigned i=0; i < ReservedColorList->size() ; i++) {
IsColorUsedArr[ (*ReservedColorList)[i] ] = true;
IsColorUsedArr[(*ReservedColorList)[i]] = true;
}
// initialize all colors used by neighbors of this node to true