Add an assertion to catch register of illegal class.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 24 Mar 2008 23:28:21 +0000 (23:28 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 24 Mar 2008 23:28:21 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48751 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocLinearScan.cpp

index 2713771ceb2389962a230042e7596dd0cccfb531..6925de3abf155cdfe046b15c26ff1c78b3585e4b 100644 (file)
@@ -886,6 +886,7 @@ unsigned RALinScan::getFreePhysReg(LiveInterval *cur) {
   // Scan for the first available register.
   TargetRegisterClass::iterator I = RC->allocation_order_begin(*mf_);
   TargetRegisterClass::iterator E = RC->allocation_order_end(*mf_);
+  assert(I != E && "No allocatable register in this register class!");
   for (; I != E; ++I)
     if (prt_->isRegAvail(*I)) {
       FreeReg = *I;