1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-03-28 06:35:49 +00:00

No major change - added some comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ruchira Sasanka 2001-10-16 01:25:05 +00:00
parent c4d4b76efb
commit 92e251cc29
2 changed files with 20 additions and 14 deletions
lib
Analysis/LiveVar
Target/SparcV9/LiveVar

@ -54,7 +54,7 @@ void MethodLiveVarInfo::constructBBs()
const BasicBlock *BB = *BBI; // get the current BB const BasicBlock *BB = *BBI; // get the current BB
if(DEBUG_LV) { cerr << " For BB "; printValue(BB); cerr << ":" << endl; } if(DEBUG_LV) { cout << " For BB "; printValue(BB); cout << ":" << endl; }
// create a new BBLiveVar // create a new BBLiveVar
BBLiveVar * LVBB = new BBLiveVar( BB, POId ); BBLiveVar * LVBB = new BBLiveVar( BB, POId );
@ -92,7 +92,7 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
bool ResultFlow, NeedAnotherIteration = false; bool ResultFlow, NeedAnotherIteration = false;
if(DEBUG_LV) if(DEBUG_LV)
cerr << endl << " After Backward Pass ..." << endl; cout << endl << " After Backward Pass ..." << endl;
po_iterator<const Method*> BBI = po_begin(Meth); po_iterator<const Method*> BBI = po_begin(Meth);
@ -102,8 +102,8 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
BBLiveVar* LVBB = BB2BBLVMap[*BBI]; BBLiveVar* LVBB = BB2BBLVMap[*BBI];
assert( LVBB ); assert( LVBB );
if(DEBUG_LV) cerr << " For BB " << (*BBI)->getName() << ":" << endl; if(DEBUG_LV) cout << " For BB " << (*BBI)->getName() << ":" << endl;
// cerr << " (POId=" << LVBB->getPOId() << ")" << endl ; // cout << " (POId=" << LVBB->getPOId() << ")" << endl ;
ResultFlow = false; ResultFlow = false;
@ -133,10 +133,13 @@ void MethodLiveVarInfo::analyze()
{ {
// Don't analyze the same method twice! // Don't analyze the same method twice!
// Later, we need to add change notification here. // Later, we need to add change notification here.
if (HasAnalyzed) if (HasAnalyzed)
return; return;
if( DEBUG_LV) cerr << "Analysing live variables ..." << endl;
if( DEBUG_LV) cout << "Analysing live variables ..." << endl;
// create and initialize all the BBLiveVars of the CFG // create and initialize all the BBLiveVars of the CFG
constructBBs(); constructBBs();
@ -149,7 +152,7 @@ void MethodLiveVarInfo::analyze()
HasAnalyzed = true; // finished analysing HasAnalyzed = true; // finished analysing
if( DEBUG_LV) cerr << "Live Variable Analysis complete!" << endl; if( DEBUG_LV) cout << "Live Variable Analysis complete!" << endl;
} }

@ -54,7 +54,7 @@ void MethodLiveVarInfo::constructBBs()
const BasicBlock *BB = *BBI; // get the current BB const BasicBlock *BB = *BBI; // get the current BB
if(DEBUG_LV) { cerr << " For BB "; printValue(BB); cerr << ":" << endl; } if(DEBUG_LV) { cout << " For BB "; printValue(BB); cout << ":" << endl; }
// create a new BBLiveVar // create a new BBLiveVar
BBLiveVar * LVBB = new BBLiveVar( BB, POId ); BBLiveVar * LVBB = new BBLiveVar( BB, POId );
@ -92,7 +92,7 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
bool ResultFlow, NeedAnotherIteration = false; bool ResultFlow, NeedAnotherIteration = false;
if(DEBUG_LV) if(DEBUG_LV)
cerr << endl << " After Backward Pass ..." << endl; cout << endl << " After Backward Pass ..." << endl;
po_iterator<const Method*> BBI = po_begin(Meth); po_iterator<const Method*> BBI = po_begin(Meth);
@ -102,8 +102,8 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
BBLiveVar* LVBB = BB2BBLVMap[*BBI]; BBLiveVar* LVBB = BB2BBLVMap[*BBI];
assert( LVBB ); assert( LVBB );
if(DEBUG_LV) cerr << " For BB " << (*BBI)->getName() << ":" << endl; if(DEBUG_LV) cout << " For BB " << (*BBI)->getName() << ":" << endl;
// cerr << " (POId=" << LVBB->getPOId() << ")" << endl ; // cout << " (POId=" << LVBB->getPOId() << ")" << endl ;
ResultFlow = false; ResultFlow = false;
@ -133,10 +133,13 @@ void MethodLiveVarInfo::analyze()
{ {
// Don't analyze the same method twice! // Don't analyze the same method twice!
// Later, we need to add change notification here. // Later, we need to add change notification here.
if (HasAnalyzed) if (HasAnalyzed)
return; return;
if( DEBUG_LV) cerr << "Analysing live variables ..." << endl;
if( DEBUG_LV) cout << "Analysing live variables ..." << endl;
// create and initialize all the BBLiveVars of the CFG // create and initialize all the BBLiveVars of the CFG
constructBBs(); constructBBs();
@ -149,7 +152,7 @@ void MethodLiveVarInfo::analyze()
HasAnalyzed = true; // finished analysing HasAnalyzed = true; // finished analysing
if( DEBUG_LV) cerr << "Live Variable Analysis complete!" << endl; if( DEBUG_LV) cout << "Live Variable Analysis complete!" << endl;
} }