MCPcopy Create free account
hub / github.com/adonovan/spaghetti / dfs

Method dfs

dom.go:84–97  ·  view source on GitHub ↗

dfs implements the depth-first search part of the LT algorithm.

(v *node, i int32, preorder []*node)

Source from the content-addressed store, hash-verified

82
83// dfs implements the depth-first search part of the LT algorithm.
84func (lt *ltState) dfs(v *node, i int32, preorder []*node) int32 {
85 preorder[i] = v
86 v.dom.pre = i // For now: DFS preorder of spanning tree of CFG
87 i++
88 lt.sdom[v.dom.index] = v
89 lt.link(nil, v)
90 for _, w := range v.imports {
91 if lt.sdom[w.dom.index] == nil {
92 lt.parent[w.dom.index] = v
93 i = lt.dfs(w, i, preorder)
94 }
95 }
96 return i
97}
98
99// eval implements the EVAL part of the LT algorithm.
100func (lt *ltState) eval(v *node) *node {

Callers 1

buildDomTreeFunction · 0.95

Calls 1

linkMethod · 0.95

Tested by

no test coverage detected