Python: Cache a few call-graph predicates

We DON'T want to recompute these ones for sure!
This commit is contained in:
Rasmus Wriedt Larsen
2022-09-23 16:27:23 +02:00
parent 6646e98d20
commit bd46b7deaa

View File

@@ -1039,6 +1039,7 @@ predicate resolveClassInstanceCall(CallNode call, Function target, Node self) {
/**
* Holds if `call` is a call to the `target`, with call-type `type`.
*/
cached
predicate resolveCall(ControlFlowNode call, Function target, CallType type) {
type instanceof CallTypePlainFunction and
call.(CallNode).getFunction() = functionTracker(target).asCfgNode() and
@@ -1114,6 +1115,7 @@ predicate normalCallArg(CallNode call, Node arg, ArgumentPosition apos) {
* Note: If `Bar.meth` and `Foo.meth` resolves to the same function, we will end up
* sending both `self` arguments to that function, which is by definition the right thing to do.
*/
cached
predicate getCallArg(
ControlFlowNode call, Function target, CallType type, Node arg, ArgumentPosition apos
) {