@@ -287,7 +287,7 @@ API::Node getSuccessorFromNode(API::Node node, AccessPathToken token) {
287
287
* Gets an API-graph successor for the given invocation.
288
288
*/
289
289
bindingset [ token]
290
- API:: Node getSuccessorFromInvoke ( API :: InvokeNode invoke , AccessPathToken token ) {
290
+ API:: Node getSuccessorFromInvoke ( Specific :: InvokeNode invoke , AccessPathToken token ) {
291
291
token .getName ( ) = "Argument" and
292
292
(
293
293
result = invoke .getParameter ( getAnIntFromStringUnbounded ( token .getAnArgument ( ) ) )
@@ -308,7 +308,7 @@ API::Node getSuccessorFromInvoke(API::InvokeNode invoke, AccessPathToken token)
308
308
* Holds if `invoke` invokes a call-site filter given by `token`.
309
309
*/
310
310
pragma [ inline]
311
- private predicate invocationMatchesCallSiteFilter ( API :: InvokeNode invoke , AccessPathToken token ) {
311
+ private predicate invocationMatchesCallSiteFilter ( Specific :: InvokeNode invoke , AccessPathToken token ) {
312
312
token .getName ( ) = "WithArity" and
313
313
invoke .getNumArgument ( ) = getAnIntFromStringUnbounded ( token .getAnArgument ( ) )
314
314
or
@@ -322,10 +322,6 @@ pragma[nomagic]
322
322
API:: Node getNodeFromPath ( string package , string type , AccessPath path , int n ) {
323
323
isRelevantFullPath ( package , type , path ) and
324
324
(
325
- type = "" and
326
- n = 0 and
327
- result = API:: moduleImport ( package )
328
- or
329
325
n = 0 and
330
326
exists ( string package2 , string type2 , AccessPath path2 |
331
327
typeModel ( package , type , package2 , type2 , path2 ) and
@@ -353,15 +349,15 @@ API::Node getNodeFromPath(string package, string type, AccessPath path) {
353
349
*
354
350
* Unlike `getNodeFromPath`, the `path` may end with one or more call-site filters.
355
351
*/
356
- API :: InvokeNode getInvocationFromPath ( string package , string type , AccessPath path , int n ) {
357
- result = getNodeFromPath ( package , type , path , n ) . getAnInvocation ( )
352
+ Specific :: InvokeNode getInvocationFromPath ( string package , string type , AccessPath path , int n ) {
353
+ result = Specific :: getAnInvocationOf ( getNodeFromPath ( package , type , path , n ) )
358
354
or
359
355
result = getInvocationFromPath ( package , type , path , n - 1 ) and
360
356
invocationMatchesCallSiteFilter ( result , path .getToken ( n - 1 ) )
361
357
}
362
358
363
359
/** Gets an invocation identified by the given `(package, type, path)` tuple. */
364
- API :: InvokeNode getInvocationFromPath ( string package , string type , AccessPath path ) {
360
+ Specific :: InvokeNode getInvocationFromPath ( string package , string type , AccessPath path ) {
365
361
result = getInvocationFromPath ( package , type , path , path .getNumToken ( ) )
366
362
}
367
363
@@ -472,12 +468,22 @@ module ModelOutput {
472
468
)
473
469
}
474
470
471
+ /**
472
+ * Holds if a relevant CSV summary row has the given `kind`, `input` and `output`.
473
+ */
474
+ predicate summaryModel ( string input , string output , string kind ) {
475
+ exists ( string package |
476
+ isRelevantPackage ( package ) and
477
+ summaryModel ( package , _, _, input , output , kind )
478
+ )
479
+ }
480
+
475
481
/**
476
482
* Holds if a summary edge with the given `input, output, kind` columns have a `package, type, path` tuple
477
483
* that resolves to `baseNode`.
478
484
*/
479
485
predicate resolvedSummaryBase (
480
- API :: InvokeNode baseNode , AccessPath input , AccessPath output , string kind
486
+ Specific :: InvokeNode baseNode , AccessPath input , AccessPath output , string kind
481
487
) {
482
488
exists ( string package , string type , AccessPath path |
483
489
summaryModel ( package , type , path , input , output , kind ) and
0 commit comments