@@ -268,7 +268,7 @@ private class AccessPathRange extends AccessPath::Range {
268268 * Gets a successor of `node` in the API graph.
269269 */
270270bindingset [ token]
271- private API:: Node getSuccessorFromNode ( API:: Node node , AccessPathToken token ) {
271+ API:: Node getSuccessorFromNode ( API:: Node node , AccessPathToken token ) {
272272 // API graphs use the same label for arguments and parameters. An edge originating from a
273273 // use-node represents be an argument, and an edge originating from a def-node represents a parameter.
274274 // We just map both to the same thing.
@@ -289,7 +289,7 @@ private API::Node getSuccessorFromNode(API::Node node, AccessPathToken token) {
289289 * Gets an API-graph successor for the given invocation.
290290 */
291291bindingset [ token]
292- private API:: Node getSuccessorFromInvoke ( API:: InvokeNode invoke , AccessPathToken token ) {
292+ API:: Node getSuccessorFromInvoke ( API:: InvokeNode invoke , AccessPathToken token ) {
293293 token .getName ( ) = "Argument" and
294294 (
295295 result = invoke .getParameter ( getAnIntFromStringUnbounded ( token .getAnArgument ( ) ) )
@@ -367,50 +367,6 @@ API::InvokeNode getInvocationFromPath(string package, string type, AccessPath pa
367367 result = getInvocationFromPath ( package , type , path , path .getNumToken ( ) )
368368}
369369
370- /**
371- * Holds if a summary edge with the given `input, output, kind` columns have a `package, type, path` tuple
372- * that resolves to `baseNode`.
373- */
374- private predicate resolvedSummaryBase (
375- API:: InvokeNode baseNode , AccessPath input , AccessPath output , string kind
376- ) {
377- exists ( string package , string type , AccessPath path |
378- summaryModel ( package , type , path , input , output , kind ) and
379- baseNode = getInvocationFromPath ( package , type , path )
380- )
381- }
382-
383- /**
384- * Holds if `path` is an input or output spec for a summary with the given `base` node.
385- */
386- pragma [ nomagic]
387- private predicate relevantInputOutputPath ( API:: InvokeNode base , AccessPath path ) {
388- resolvedSummaryBase ( base , path , _, _)
389- or
390- resolvedSummaryBase ( base , _, path , _)
391- }
392-
393- /**
394- * Gets the API node for the first `n` tokens of the given input/output path, evaluated relative to `baseNode`.
395- */
396- private API:: Node getNodeFromInputOutputPath ( API:: InvokeNode baseNode , AccessPath path , int n ) {
397- relevantInputOutputPath ( baseNode , path ) and
398- (
399- n = 1 and
400- result = getSuccessorFromInvoke ( baseNode , path .getToken ( 0 ) )
401- or
402- result =
403- getSuccessorFromNode ( getNodeFromInputOutputPath ( baseNode , path , n - 1 ) , path .getToken ( n - 1 ) )
404- )
405- }
406-
407- /**
408- * Gets the API node for the given input/output path, evaluated relative to `baseNode`.
409- */
410- private API:: Node getNodeFromInputOutputPath ( API:: InvokeNode baseNode , AccessPath path ) {
411- result = getNodeFromInputOutputPath ( baseNode , path , path .getNumToken ( ) )
412- }
413-
414370/**
415371 * Convenience-predicate for extracting two capture groups at once.
416372 */
@@ -519,13 +475,15 @@ module ModelOutput {
519475 }
520476
521477 /**
522- * Holds if a CSV summary contributed the step `pred -> succ` of the given `kind`.
478+ * Holds if a summary edge with the given `input, output, kind` columns have a `package, type, path` tuple
479+ * that resolves to `baseNode`.
523480 */
524- predicate summaryStep ( API:: Node pred , API:: Node succ , string kind ) {
525- exists ( API:: InvokeNode base , AccessPath input , AccessPath output |
526- resolvedSummaryBase ( base , input , output , kind ) and
527- pred = getNodeFromInputOutputPath ( base , input ) and
528- succ = getNodeFromInputOutputPath ( base , output )
481+ predicate resolvedSummaryBase (
482+ API:: InvokeNode baseNode , AccessPath input , AccessPath output , string kind
483+ ) {
484+ exists ( string package , string type , AccessPath path |
485+ summaryModel ( package , type , path , input , output , kind ) and
486+ baseNode = getInvocationFromPath ( package , type , path )
529487 )
530488 }
531489
0 commit comments