@@ -86,7 +86,7 @@ julia> mis[1].specTypes
86
86
Tuple{typeof(findfirst),BitArray{1}}
87
87
```
88
88
89
- ## Getting the backedges for a function
89
+ ### Getting the backedges for a function
90
90
91
91
Let's see all the compiled instances of ` Base.setdiff ` and their immediate callers:
92
92
@@ -98,6 +98,49 @@ julia> direct_backedges(setdiff)
98
98
MethodInstance for setdiff(::Array{Base.UUID,1}, ::Array{Base.UUID,1}) => MethodInstance for deps_graph(::Pkg.Types.Context, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Resolve.Fixed})
99
99
```
100
100
101
+ ### Printing backedges as a tree
102
+
103
+ MethodAnalysis uses [ AbstractTrees] ( https://github.com/JuliaCollections/AbstractTrees.jl ) to display the complete set of backedges:
104
+
105
+ ``` jldoctest; setup=:(using MethodAnalysis)
106
+ julia> mi = instance(findfirst, (BitVector,))
107
+ MethodInstance for findfirst(::BitArray{1})
108
+
109
+ julia> MethodAnalysis.print_tree(mi)
110
+ MethodInstance for findfirst(::BitArray{1})
111
+ ├─ MethodInstance for prune_graph!(::Graph)
112
+ │ └─ MethodInstance for #simplify_graph!#111(::Bool, ::typeof(simplify_graph!), ::Graph, ::Set{Int64})
113
+ │ └─ MethodInstance for simplify_graph!(::Graph, ::Set{Int64})
114
+ │ └─ MethodInstance for simplify_graph!(::Graph)
115
+ │ ├─ MethodInstance for trigger_failure!(::Graph, ::Array{Int64,1}, ::Tuple{Int64,Int64})
116
+ │ │ ⋮
117
+ │ │
118
+ │ └─ MethodInstance for resolve_versions!(::Context, ::Array{PackageSpec,1})
119
+ │ ⋮
120
+ │
121
+ └─ MethodInstance for update_solution!(::SolutionTrace, ::Graph)
122
+ └─ MethodInstance for converge!(::Graph, ::Messages, ::SolutionTrace, ::NodePerm, ::MaxSumParams)
123
+ ├─ MethodInstance for converge!(::Graph, ::Messages, ::SolutionTrace, ::NodePerm, ::MaxSumParams)
124
+ │ ├─ MethodInstance for converge!(::Graph, ::Messages, ::SolutionTrace, ::NodePerm, ::MaxSumParams)
125
+ │ │ ├─ MethodInstance for converge!(::Graph, ::Messages, ::SolutionTrace, ::NodePerm, ::MaxSumParams)
126
+ │ │ │ ⋮
127
+ │ │ │
128
+ │ │ └─ MethodInstance for maxsum(::Graph)
129
+ │ │ ⋮
130
+ │ │
131
+ │ └─ MethodInstance for maxsum(::Graph)
132
+ │ └─ MethodInstance for resolve(::Graph)
133
+ │ ⋮
134
+ │
135
+ └─ MethodInstance for maxsum(::Graph)
136
+ └─ MethodInstance for resolve(::Graph)
137
+ ├─ MethodInstance for trigger_failure!(::Graph, ::Array{Int64,1}, ::Tuple{Int64,Int64})
138
+ │ ⋮
139
+ │
140
+ └─ MethodInstance for resolve_versions!(::Context, ::Array{PackageSpec,1})
141
+ ⋮
142
+ ```
143
+
101
144
## API reference
102
145
103
146
### visit
0 commit comments