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