Changed DataflowSolver to always associated recorded dataflow values with

the position *before* a statement, regardless of whether we are doing a
forward or backwards analysis.

llvm-svn: 46151
This commit is contained in:
Ted Kremenek 2008-01-18 00:38:55 +00:00
parent ab405774b6
commit 1989d2569b
1 changed files with 12 additions and 4 deletions

View File

@ -235,10 +235,18 @@ private:
/// ProcessBlock - Process the transfer functions for a given block. /// ProcessBlock - Process the transfer functions for a given block.
void ProcessBlock(const CFGBlock* B, bool recordStmtValues) { void ProcessBlock(const CFGBlock* B, bool recordStmtValues) {
for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I) { for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)
if (recordStmtValues) D.getStmtDataMap()[*I] = TF.getVal(); ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
TF.BlockStmt_Visit(const_cast<Stmt*>(*I)); }
}
void ProcessStmt(const Stmt* S, bool record, dataflow::forward_analysis_tag) {
if (record) D.getStmtDataMap()[S] = TF.getVal();
TF.BlockStmt_Visit(const_cast<Stmt*>(S));
}
void ProcessStmt(const Stmt* S, bool record, dataflow::backward_analysis_tag){
TF.BlockStmt_Visit(const_cast<Stmt*>(S));
if (record) D.getStmtDataMap()[S] = TF.getVal();
} }
/// UpdateEdges - After processing the transfer functions for a /// UpdateEdges - After processing the transfer functions for a