private void ConstructCandidateDependenceGraph() { if (CommandLineOptions.Clo.Trace) { Console.WriteLine("Candidate dependence analysis: Building dependence graph"); } ICandidateReachabilityChecker reachabilityChecker; if (CommandLineOptions.Clo.StagedHoudiniReachabilityAnalysis) { reachabilityChecker = new CandidateReachabilityChecker(prog, candidates); } else { reachabilityChecker = new DummyCandidateReachabilityChecker(); } CandidateDependences = new Graph <string>(); foreach (var c in candidates) { CandidateDependences.AddEdge(c, c); foreach (var vd in candidateDependsOn[c]) { if (variableDirectlyReferredToByCandidates.ContainsKey(vd)) { foreach (var d in variableDirectlyReferredToByCandidates[vd]) { if (reachabilityChecker.MayReach(d, c)) { CandidateDependences.AddEdge(c, d); } } } } } if (CommandLineOptions.Clo.StagedHoudiniMergeIgnoredCandidates) { MergeIgnoredCandidates(); } }
private void ConstructCandidateDependenceGraph() { if (CommandLineOptions.Clo.Trace) { Console.WriteLine("Candidate dependence analysis: Building dependence graph"); } ICandidateReachabilityChecker reachabilityChecker; if(CommandLineOptions.Clo.StagedHoudiniReachabilityAnalysis) { reachabilityChecker = new CandidateReachabilityChecker(prog, candidates); } else { reachabilityChecker = new DummyCandidateReachabilityChecker(); } CandidateDependences = new Graph<string>(); foreach (var c in candidates) { CandidateDependences.AddEdge(c, c); foreach (var vd in candidateDependsOn[c]) { if (variableDirectlyReferredToByCandidates.ContainsKey(vd)) { foreach (var d in variableDirectlyReferredToByCandidates[vd]) { if(reachabilityChecker.MayReach(d, c)) { CandidateDependences.AddEdge(c, d); } } } } } if(CommandLineOptions.Clo.StagedHoudiniMergeIgnoredCandidates) { MergeIgnoredCandidates(); } }