@@ -473,36 +473,6 @@ module API {
473473 /** Gets a data flow node that flows to the RHS of a def-node. */
474474 private DataFlow:: LocalSourceNode defCand ( ) { result = defCand ( TypeBackTracker:: end ( ) ) }
475475
476- private Label:: ApiLabel getLabelFromArgumentPosition ( DataFlowDispatch:: ArgumentPosition pos ) {
477- exists ( int n |
478- pos .isPositional ( n ) and
479- result = Label:: parameter ( n )
480- )
481- or
482- exists ( string name |
483- pos .isKeyword ( name ) and
484- result = Label:: keywordParameter ( name )
485- )
486- or
487- pos .isBlock ( ) and
488- result = Label:: blockParameter ( )
489- }
490-
491- private Label:: ApiLabel getLabelFromParameterPosition ( DataFlowDispatch:: ParameterPosition pos ) {
492- exists ( int n |
493- pos .isPositional ( n ) and
494- result = Label:: parameter ( n )
495- )
496- or
497- exists ( string name |
498- pos .isKeyword ( name ) and
499- result = Label:: keywordParameter ( name )
500- )
501- or
502- pos .isBlock ( ) and
503- result = Label:: blockParameter ( )
504- }
505-
506476 /**
507477 * Holds if there should be a `lbl`-edge from the given call to an argument.
508478 */
@@ -512,7 +482,7 @@ module API {
512482 ) {
513483 exists ( DataFlowDispatch:: ArgumentPosition argPos |
514484 argument .sourceArgumentOf ( call .asExpr ( ) , argPos ) and
515- lbl = getLabelFromArgumentPosition ( argPos )
485+ lbl = Label :: getLabelFromArgumentPosition ( argPos )
516486 )
517487 }
518488
@@ -525,7 +495,7 @@ module API {
525495 ) {
526496 exists ( DataFlowDispatch:: ParameterPosition paramPos |
527497 paramNode .isSourceParameterOf ( callable .asExpr ( ) .getExpr ( ) , paramPos ) and
528- lbl = getLabelFromParameterPosition ( paramPos )
498+ lbl = Label :: getLabelFromParameterPosition ( paramPos )
529499 )
530500 }
531501
@@ -803,5 +773,37 @@ module API {
803773
804774 /** Gets the label for the edge from the root node to a custom entry point of the given name. */
805775 LabelEntryPoint entryPoint ( API:: EntryPoint name ) { result .getName ( ) = name }
776+
777+ /** Gets the API graph label corresponding to the given argument position. */
778+ Label:: ApiLabel getLabelFromArgumentPosition ( DataFlowDispatch:: ArgumentPosition pos ) {
779+ exists ( int n |
780+ pos .isPositional ( n ) and
781+ result = Label:: parameter ( n )
782+ )
783+ or
784+ exists ( string name |
785+ pos .isKeyword ( name ) and
786+ result = Label:: keywordParameter ( name )
787+ )
788+ or
789+ pos .isBlock ( ) and
790+ result = Label:: blockParameter ( )
791+ }
792+
793+ /** Gets the API graph label corresponding to the given parameter position. */
794+ Label:: ApiLabel getLabelFromParameterPosition ( DataFlowDispatch:: ParameterPosition pos ) {
795+ exists ( int n |
796+ pos .isPositional ( n ) and
797+ result = Label:: parameter ( n )
798+ )
799+ or
800+ exists ( string name |
801+ pos .isKeyword ( name ) and
802+ result = Label:: keywordParameter ( name )
803+ )
804+ or
805+ pos .isBlock ( ) and
806+ result = Label:: blockParameter ( )
807+ }
806808 }
807809}
0 commit comments