diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-05 00:34:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-05 00:34:50 +0000 |
commit | ab584111e7ea03a293b9f5bd8b0830edfdce7450 (patch) | |
tree | 2becf676fe2bf1191521a3693ab09e13a0bc94c4 /lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp | |
parent | 0174410fd05717bde6b4006385af498083ca280b (diff) |
* 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp')
-rw-r--r-- | lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp index 645735c2cc..de66f33cb0 100644 --- a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp +++ b/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 |