1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

Get rid of the abort in PhyRegAlloc::finishSavingState().

Make an explicit call to it from runOnFunction() if we know we're supposed to
write into the global. This is lame (esp. the const_cast), but it solves
the problem.

llvm-svn: 12291
This commit is contained in:
Brian Gaeke 2004-03-11 19:46:30 +00:00
parent e6916ff3b4
commit ede938b425

View File

@ -1232,9 +1232,9 @@ bool PhyRegAlloc::doFinalization (Module &M) {
/// state; this one is cumbersome and does not work well with the JIT. /// state; this one is cumbersome and does not work well with the JIT.
/// ///
void PhyRegAlloc::finishSavingState (Module &M) { void PhyRegAlloc::finishSavingState (Module &M) {
if (DEBUG_RA)
std::cerr << "---- Saving reg. alloc state; SaveStateToModule = " std::cerr << "---- Saving reg. alloc state; SaveStateToModule = "
<< SaveStateToModule << " ----\n"; << SaveStateToModule << " ----\n";
abort ();
// If saving state into the module, just copy new elements to the // If saving state into the module, just copy new elements to the
// correct global. // correct global.
@ -1379,9 +1379,10 @@ bool PhyRegAlloc::runOnFunction (Function &F) {
// Save register allocation state for this function in a Constant. // Save register allocation state for this function in a Constant.
if (SaveRegAllocState) { if (SaveRegAllocState) {
saveState(); saveState();
if (DEBUG_RA) { // Check our work. if (DEBUG_RA) // Check our work.
verifySavedState (); verifySavedState ();
} if (!SaveStateToModule)
finishSavingState (const_cast<Module&> (*Fn->getParent ()));
} }
// Now update the machine code with register names and add any additional // Now update the machine code with register names and add any additional