Publicize the type of FnAllocState.
[oota-llvm.git] / lib / CodeGen / RegAlloc / PhyRegAlloc.cpp
index 82ba0cc693cd7070f8e40a12cc8f406856a9e647..e70c90b039426c05027c731a443513bb620416b7 100644 (file)
 
 RegAllocDebugLevel_t DEBUG_RA;
 
+/// The reoptimizer wants to be able to grovel through the register
+/// allocator's state after it has done its job. This is a hack.
+///
+PhyRegAlloc::SavedStateMapTy ExportedFnAllocState;
+const bool SaveStateToModule = false;
+
 static cl::opt<RegAllocDebugLevel_t, true>
 DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
         cl::desc("enable register allocation debugging information"),
@@ -1184,6 +1190,11 @@ bool PhyRegAlloc::doFinalization (Module &M) {
   if (!SaveRegAllocState)
     return false; // Nothing to do here, unless we're saving state.
 
+  if (!SaveStateToModule) {
+    ExportedFnAllocState = FnAllocState;
+    return false;
+  }
+
   // Convert FnAllocState to a single Constant array and add it
   // to the Module.
   ArrayType *AT = ArrayType::get (AllocInfo::getConstantType (), 0);