codeql icon indicating copy to clipboard operation
codeql copied to clipboard

Dynamic: add TypeModel.isTypeUsed

Open asgerf opened this issue 2 years ago • 0 comments

There was a bug in the design of TypeModel, that meant when pruning models we have no way of knowing which types might be contributed via a TypeModel.

This PR adds a predicate TypeModel.isTypeUsed(type) and then implementors must use it to expose this information. To simplify its use in simple cases, the implementor is able to use the body any() to disable all pruning.

We want to be able to prune irrelevant models, and in order to generate flow summaries from a model, the pruning information cannot depend on data-flow nodes. For that reason, each language now has a recursion guard that prevents isTypeUsed from depending on DataFlow::Node.

asgerf avatar Sep 01 '23 12:09 asgerf