diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-05-23 15:50:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-05-23 15:50:03 +0000 |
| commit | abe98198a83c7f3ca35a1785de11b5b6b3037acf (patch) | |
| tree | 1c004ccc10e2fb28a3c46496abc2b71e476629e4 /llvm/lib/CodeGen/RegAlloc/RegClass.cpp | |
| parent | 54474c75ec3e716ccbd428a0037ce06dfcac6fa3 (diff) | |
| download | llvm-abe98198a83c7f3ca35a1785de11b5b6b3037acf.zip llvm-abe98198a83c7f3ca35a1785de11b5b6b3037acf.tar.gz llvm-abe98198a83c7f3ca35a1785de11b5b6b3037acf.tar.bz2 | |
Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector. This makes asserting on array bounds easier.
llvm-svn: 2731
Diffstat (limited to 'llvm/lib/CodeGen/RegAlloc/RegClass.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAlloc/RegClass.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/RegClass.cpp b/llvm/lib/CodeGen/RegAlloc/RegClass.cpp index c680bbf..5998f1f 100644 --- a/llvm/lib/CodeGen/RegAlloc/RegClass.cpp +++ b/llvm/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 |
