summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-05 00:34:50 +0000
committerChris Lattner <sabre@nondot.org>2002-02-05 00:34:50 +0000
commit7c70802193106d1c3ad6032366fac3e5e01ba498 (patch)
tree33ee060d51f9a33e5a3bad1d3803852da6bde1de /llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
parent94b8baf089a77c2d9d35972ca04636b269a5b16f (diff)
downloadbcm5719-llvm-7c70802193106d1c3ad6032366fac3e5e01ba498.tar.gz
bcm5719-llvm-7c70802193106d1c3ad6032366fac3e5e01ba498.zip
* Give BBLiveVar.cpp a proper file header
* applyFlowFunc DOES NOT NEED TO COPY the huge BB->BBLiveVar Map every time it is invoked! * Big cleanups. * Make BBLiveVar.h effectively an internal header file * Prepare LiveVarMap.h for deletion llvm-svn: 1706
Diffstat (limited to 'llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index 645735c2cc7..de66f33cb09 100644
--- a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
@@ -10,6 +10,7 @@
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
+#include "llvm/Analysis/LiveVar/BBLiveVar.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/BasicBlock.h"
#include "Support/PostOrderIterator.h"
@@ -17,6 +18,20 @@
AnalysisID MethodLiveVarInfo::ID(AnalysisID::create<MethodLiveVarInfo>());
+//-----------------------------------------------------------------------------
+// Accessor Functions
+//-----------------------------------------------------------------------------
+
+// gets OutSet of a BB
+const LiveVarSet *MethodLiveVarInfo::getOutSetOfBB(const BasicBlock *BB) const {
+ return BB2BBLVMap.find(BB)->second->getOutSet();
+}
+
+// gets InSet of a BB
+const LiveVarSet *MethodLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const {
+ return BB2BBLVMap.find(BB)->second->getInSet();
+}
+
//-----------------------------------------------------------------------------
// Performs live var analysis for a method
@@ -103,7 +118,8 @@ void MethodLiveVarInfo::releaseMemory() {
// First delete all BBLiveVar objects created in constructBBs(). A new object
// of type BBLiveVar is created for every BasicBlock in the method
//
- for (BBToBBLiveVarMapType::iterator HMI = BB2BBLVMap.begin(),
+ for (std::map<const BasicBlock *, BBLiveVar *>::iterator
+ HMI = BB2BBLVMap.begin(),
HME = BB2BBLVMap.end(); HMI != HME; ++HMI)
delete HMI->second; // delete all BBLiveVar in BB2BBLVMap
@@ -115,7 +131,8 @@ void MethodLiveVarInfo::releaseMemory() {
// is sufficient to free up all LiveVarSet using only one cache since
// both caches refer to the same sets
//
- for (MInstToLiveVarSetMapType::iterator MI = MInst2LVSetBI.begin(),
+ for (std::map<const MachineInstr*, const LiveVarSet*>::iterator
+ MI = MInst2LVSetBI.begin(),
ME = MInst2LVSetBI.end(); MI != ME; ++MI)
delete MI->second; // delete all LiveVarSets in MInst2LVSetBI
OpenPOWER on IntegriCloud