aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAlloc/RegClass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-23 15:50:03 +0000
committerChris Lattner <sabre@nondot.org>2002-05-23 15:50:03 +0000
commit85c5465e072b3bbebb1f5e112fb2db46f7fba148 (patch)
tree180e26923207d78d82621158e9f5476d9554008d /lib/CodeGen/RegAlloc/RegClass.cpp
parent195755ced7b7fb8b941e5d085fe5bd82f36f481e (diff)
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
Diffstat (limited to 'lib/CodeGen/RegAlloc/RegClass.cpp')
-rw-r--r--lib/CodeGen/RegAlloc/RegClass.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/RegAlloc/RegClass.cpp b/lib/CodeGen/RegAlloc/RegClass.cpp
index c680bbfc31..5998f1fd66 100644
--- a/lib/CodeGen/RegAlloc/RegClass.cpp
+++ b/lib/CodeGen/RegAlloc/RegClass.cpp
@@ -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