// If procedure abstraction is active, detect procedures now
if (cfr.isCompleted() && Options.procedureAbstraction.getValue() == 2) {
cfr = null;
reached = null;
ProcedureAnalysis procedureAnalysis = new ProcedureAnalysis();
CPAAlgorithm cpaAlg = CPAAlgorithm.createForwardAlgorithm(program, procedureAnalysis);
runAlgorithm(cpaAlg);
reached = cpaAlg.getReachedStates().select(1);
Set<Location> procedures = procedureAnalysis.getCallees();
SetMultimap<Location, Location> callGraph = HashMultimap.create();
// Procedure analysis and thus this callgraph only works with --procedures 2
// A broken callgraph does not affect the safety checks, though, as all
// procedures are checked without any interprocedural abstraction anyway
for (Pair<Location,Location> callSite : procedureAnalysis.getCallSites()) {
ProcedureState procedureState = (ProcedureState)Lattices.joinAll(reached.where(callSite.getLeft()));
for (Location procedure : procedureState.getProcedureEntries()) {
callGraph.put(procedure, callSite.getRight());
}
}