[llvm-commits] CVS: llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu Mar 11 13:47:01 PST 2004


Changes in directory llvm/lib/Target/SparcV9/RegAlloc:

PhyRegAlloc.cpp updated: 1.143 -> 1.144

---
Log message:

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.


---
Diffs of the changes:  (+6 -5)

Index: llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
diff -u llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.143 llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.144
--- llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.143	Thu Mar 11 00:45:51 2004
+++ llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp	Thu Mar 11 13:46:30 2004
@@ -1232,9 +1232,9 @@
 /// state; this one is cumbersome and does not work well with the JIT.
 ///
 void PhyRegAlloc::finishSavingState (Module &M) {
-  std::cerr << "---- Saving reg. alloc state; SaveStateToModule = "
-            << SaveStateToModule << " ----\n";
-  abort ();
+  if (DEBUG_RA)
+    std::cerr << "---- Saving reg. alloc state; SaveStateToModule = "
+              << SaveStateToModule << " ----\n";
 
   // If saving state into the module, just copy new elements to the
   // correct global.
@@ -1379,9 +1379,10 @@
   // Save register allocation state for this function in a Constant.
   if (SaveRegAllocState) {
     saveState();
-    if (DEBUG_RA) { // Check our work.
+    if (DEBUG_RA) // Check our work.
       verifySavedState ();
-    }
+    if (!SaveStateToModule)
+      finishSavingState (const_cast<Module&> (*Fn->getParent ()));
   }
 
   // Now update the machine code with register names and add any additional





More information about the llvm-commits mailing list