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:
parent
ab405774b6
commit
1989d2569b
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue