Beispiel #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);
        }
Beispiel #2
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));
        }
Beispiel #3
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);
        }
Beispiel #4
0
 public void RemoveEdge(CallGraphStructure structure, IReadonlyCountingSet <ElementId> rootMarks, IReadonlyCountingSet <ElementId> banMarks, ElementId startVertex,
                        ElementId endVertex)
 {
 }
Beispiel #5
0
 public bool PropagateIfUnmarked(CallGraphStructure structure, IReadonlyCountingSet <ElementId> rootMarks, IReadonlyCountingSet <ElementId> banMarks, ElementId vertex)
 {
     return(false);
 }
Beispiel #6
0
 public bool IsMarkedGlobal(CallGraphStructure structure, IReadonlyCountingSet <ElementId> rootMarks, IReadonlyCountingSet <ElementId> banMarks, ElementId vertex)
 {
     return(false);
 }
Beispiel #7
0
 public void RootVertex(CallGraphStructure structure, IReadonlyCountingSet <ElementId> rootMarks, IReadonlyCountingSet <ElementId> banMarks, ElementId vertex)
 {
 }