Skip to content

add evaluateFunctionExit for backward analyzer in monotone-analyzer #7547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/analysis/monotone-analyzer-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ inline void
MonotoneCFGAnalyzer<L, TxFn>::evaluateFunctionEntry(Function* func) {
txfn.evaluateFunctionEntry(func, states[0]);
}
template<Lattice L, TransferFunction TxFn>
inline void MonotoneCFGAnalyzer<L, TxFn>::evaluateFunctionExit(Function* func) {
for (size_t i = 0; i < cfg.size(); i++) {
if (cfg[i].isExit()) {
txfn.evaluateFunctionExit(func, states[i]);
break;
}
}
}

template<Lattice L, TransferFunction TxFn>
inline void MonotoneCFGAnalyzer<L, TxFn>::evaluate() {
Expand Down
5 changes: 5 additions & 0 deletions src/analysis/monotone-analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ template<Lattice L, TransferFunction TxFn> class MonotoneCFGAnalyzer {
// entry block depends on no other blocks, and hence cannot be changed by
// them.
void evaluateFunctionEntry(Function* func);
// This modifies the state of the CFG's exit block, with function
// information. This cannot be done otherwise in a backward analysis, as the
// exit block depends on no other blocks, and hence cannot be changed by
// them.
void evaluateFunctionExit(Function* func);

// Iterates over all of the BlockStates after evaluate() is completed for the
// transfer function to collect the finalized intermediate states from each
Expand Down
Loading