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

15 lines, 11 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(f, s) :- call(f, s, "mylib.MaybeCollect").
15might_collect(f, s) :- call(f, s, g), might_collect(g, _).