diff --git a/src/analysis/monotone-analyzer-impl.h b/src/analysis/monotone-analyzer-impl.h index fc2fbf7060d..74e33b62c0d 100644 --- a/src/analysis/monotone-analyzer-impl.h +++ b/src/analysis/monotone-analyzer-impl.h @@ -21,6 +21,15 @@ inline void MonotoneCFGAnalyzer::evaluateFunctionEntry(Function* func) { txfn.evaluateFunctionEntry(func, states[0]); } +template +inline void MonotoneCFGAnalyzer::evaluateFunctionExit(Function* func) { + for (size_t i = 0; i < cfg.size(); i++) { + if (cfg[i].isExit()) { + txfn.evaluateFunctionExit(func, states[i]); + break; + } + } +} template inline void MonotoneCFGAnalyzer::evaluate() { diff --git a/src/analysis/monotone-analyzer.h b/src/analysis/monotone-analyzer.h index c2ec7c2b4a2..91251103248 100644 --- a/src/analysis/monotone-analyzer.h +++ b/src/analysis/monotone-analyzer.h @@ -34,6 +34,11 @@ template 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