// }
// Make sure flags are computed
scope.computeScopeFlags();
LiveVariablesProblem lvp = new LiveVariablesProblem(scope);
if (scope instanceof IRClosure) {
// Go conservative! Normally, closure scopes are analyzed
// in the context of their outermost method scopes where we
// have better knowledge of aliveness in that global context.
//
// But, if we are analyzing closures standalone, we have to
// conservatively assume that any dirtied variables that
// belong to an outer scope are live on exit.
Set<LocalVariable> nlVars = new HashSet<LocalVariable>();
collectNonLocalDirtyVars((IRClosure)scope, nlVars, scope.getFlags().contains(IRFlags.DYNSCOPE_ELIMINATED) ? -1 : 0);
// Init DF vars from this set
for (Variable v: nlVars) {
lvp.addDFVar(v);
}
lvp.setVarsLiveOnScopeExit(nlVars);
}
lvp.compute_MOP_Solution();
scope.setDataFlowSolution(LiveVariablesProblem.NAME, lvp);
return lvp;
}