예제 #1
0
        public override bool PropagateIfUnmarked(CallGraphStructure structure, IReadonlyCountingSet <ElementId> rootMarks, IReadonlyCountingSet <ElementId> banMarks,
                                                 bool isGlobalStage, ElementId vertex)
        {
            if (rootMarks.Contains(vertex))
            {
                return(true);
            }

            if (banMarks.Contains(vertex) == false)
            {
                return(base.PropagateIfUnmarked(structure, rootMarks, banMarks, isGlobalStage, vertex));
            }

            foreach (var(parent, _) in structure.InvertedEdges.GetOrEmpty(vertex))
            {
                if (banMarks.Contains(parent))
                {
                    continue;
                }

                if (base.PropagateIfUnmarked(structure, rootMarks, banMarks, isGlobalStage, parent))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #2
0
        public override bool IsMarkedGlobal(
            CallGraphStructure structure,
            IReadonlyCountingSet <ElementId> rootMarks,
            IReadonlyCountingSet <ElementId> banMarks,
            ElementId vertex)
        {
            var strict = structure.BanMarks.GetOrEmpty(BurstStrictlyBannedMarkProvider.RootMarkId);

            // method has burst discard and resharper.disable
            if (strict.Contains(vertex))
            {
                return(false);
            }

            if (rootMarks.Contains(vertex))
            {
                return(true);
            }

            // method has no managed code
            if (banMarks.Contains(vertex) == false)
            {
                return(base.IsMarkedGlobal(structure, rootMarks, banMarks, vertex));
            }

            // method has managed code, question - does it have direct burst route?
            foreach (var(parent, _) in structure.InvertedEdges.GetOrEmpty(vertex))
            {
                if (banMarks.Contains(parent))
                {
                    continue;
                }

                if (base.IsMarkedGlobal(structure, rootMarks, banMarks, parent))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
        public override bool IsMarkedLocal(CallGraphStructure structure, IReadonlyCountingSet <ElementId> rootMarks,
                                           IReadonlyCountingSet <ElementId> banMarks, ElementId vertex)
        {
            if (structure.Vertices.Contains(vertex) == false)
            {
                return(false);
            }

            var strict = structure.BanMarks.GetOrEmpty(BurstStrictlyBannedMarkProvider.RootMarkId);

            return(rootMarks.Contains(vertex) && !strict.Contains(vertex));
        }