aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-10-24 21:21:58 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-10-24 21:21:58 +0000
commit8fc493430c2265da5b7c46cf50ab93a75a00b2f3 (patch)
tree8efe68ba587a8eab0c22e73c0634e16480f794eb /lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
parent3e43026095f273919daed6633cc838700f837a77 (diff)
Publicize the type of FnAllocState.
Prototype option to save state in a global instead of as a Constant in the Module. (Turned off, for now, with the on/off switch welded in the off position. You get the idea.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAlloc/PhyRegAlloc.cpp')
-rw-r--r--lib/CodeGen/RegAlloc/PhyRegAlloc.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
index 82ba0cc693..e70c90b039 100644
--- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
+++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
@@ -48,6 +48,12 @@
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);