コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
              }
        }