summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-06-25 16:12:52 +0000
committerChris Lattner <sabre@nondot.org>2002-06-25 16:12:52 +0000
commitfda72b1aad8c70686418b2a7dfa8adbc20435b0e (patch)
tree38f0e80982c981aa44c29edb9103c02f01d7d121 /llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
parent6e3c5fada642c209d476042115cf03df6b48b4ea (diff)
downloadbcm5719-llvm-fda72b1aad8c70686418b2a7dfa8adbc20435b0e.tar.gz
bcm5719-llvm-fda72b1aad8c70686418b2a7dfa8adbc20435b0e.zip
*** empty log message ***
llvm-svn: 2777
Diffstat (limited to 'llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index 11056406124..ab0a761b732 100644
--- a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
@@ -33,12 +33,12 @@ static cl::Enum<LiveVarDebugLevel_t> DEBUG_LV_opt(DEBUG_LV, "dlivevar", cl::Hidd
// gets OutSet of a BB
const ValueSet &FunctionLiveVarInfo::getOutSetOfBB(const BasicBlock *BB) const {
- return BBLiveVar::GetFromBB(BB)->getOutSet();
+ return BBLiveVar::GetFromBB(*BB)->getOutSet();
}
// gets InSet of a BB
const ValueSet &FunctionLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const {
- return BBLiveVar::GetFromBB(BB)->getInSet();
+ return BBLiveVar::GetFromBB(*BB)->getInSet();
}
@@ -46,15 +46,15 @@ const ValueSet &FunctionLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const {
// Performs live var analysis for a function
//-----------------------------------------------------------------------------
-bool FunctionLiveVarInfo::runOnFunction(Function *Meth) {
- M = Meth;
+bool FunctionLiveVarInfo::runOnFunction(Function &F) {
+ M = &F;
if (DEBUG_LV) std::cerr << "Analysing live variables ...\n";
// create and initialize all the BBLiveVars of the CFG
- constructBBs(Meth);
+ constructBBs(M);
unsigned int iter=0;
- while (doSingleBackwardPass(Meth, iter++))
+ while (doSingleBackwardPass(M, iter++))
; // Iterate until we are done.
if (DEBUG_LV) std::cerr << "Live Variable Analysis complete!\n";
@@ -71,7 +71,7 @@ void FunctionLiveVarInfo::constructBBs(const Function *M) {
for(po_iterator<const Function*> BBI = po_begin(M), BBE = po_end(M);
BBI != BBE; ++BBI, ++POId) {
- const BasicBlock *BB = *BBI; // get the current BB
+ const BasicBlock &BB = **BBI; // get the current BB
if (DEBUG_LV) std::cerr << " For BB " << RAV(BB) << ":\n";
@@ -105,7 +105,7 @@ bool FunctionLiveVarInfo::doSingleBackwardPass(const Function *M,
bool NeedAnotherIteration = false;
for (po_iterator<const Function*> BBI = po_begin(M), BBE = po_end(M);
BBI != BBE; ++BBI) {
- BBLiveVar *LVBB = BBLiveVar::GetFromBB(*BBI);
+ BBLiveVar *LVBB = BBLiveVar::GetFromBB(**BBI);
assert(LVBB && "BasicBlock information not set for block!");
if (DEBUG_LV) std::cerr << " For BB " << (*BBI)->getName() << ":\n";
OpenPOWER on IntegriCloud