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

Function numberDomTree

dom.go:229–238  ·  view source on GitHub ↗

numberDomTree sets the pre- and post-order numbers of a depth-first traversal of the dominator tree rooted at v. These are used to answer dominance queries in constant time.

(v *node, pre, post int32)

Source from the content-addressed store, hash-verified

227// answer dominance queries in constant time.
228//
229func numberDomTree(v *node, pre, post int32) (int32, int32) {
230 v.dom.pre = pre
231 pre++
232 for _, child := range v.dom.children {
233 pre, post = numberDomTree(child, pre, post)
234 }
235 v.dom.post = post
236 post++
237 return pre, post
238}

Callers 1

buildDomTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected