OILS / mycpp / datalog / call-graph.dl View on Github | oilshell.org

16 lines, 12 significant
1.once
2
3.include "control-flow.dl"
4
5// At statement s, caller invokes callee.
6.decl call(caller: Function, s: Statement, callee:Function)
7.input call
8
9// (f, s) is in this set if there is a call into the garbage collector, either
10// directly or indirectly, at statement s in function f.
11.decl might_collect(f: Function, s: Statement)
12.output might_collect
13
14might_collect("mylib.MaybeCollect", 0).
15might_collect(f, s) :- call(f, s, "mylib.MaybeCollect").
16might_collect(f, s) :- call(f, s, g), might_collect(g, _).