@@ -61,6 +61,13 @@ private newtype TIRDataFlowNode =
61
61
} or
62
62
TFinalGlobalValue ( Ssa:: GlobalUse globalUse ) or
63
63
TInitialGlobalValue ( Ssa:: GlobalDef globalUse ) or
64
+ TBodyLessParameterNodeImpl ( Parameter p , int indirectionIndex ) {
65
+ // We subtract one because `getMaxIndirectionsForType` returns the maximum
66
+ // indirection for a glvalue of a given type, and this doesn't apply to
67
+ // parameters.
68
+ indirectionIndex = [ 0 .. Ssa:: getMaxIndirectionsForType ( p .getUnspecifiedType ( ) ) - 1 ] and
69
+ not any ( InitializeParameterInstruction init ) .getParameter ( ) = p
70
+ } or
64
71
TFlowSummaryNode ( FlowSummaryImpl:: Private:: SummaryNode sn )
65
72
66
73
/**
@@ -737,6 +744,39 @@ class InitialGlobalValue extends Node, TInitialGlobalValue {
737
744
override string toStringImpl ( ) { result = globalDef .toString ( ) }
738
745
}
739
746
747
+ /**
748
+ * INTERNAL: do not use.
749
+ *
750
+ * A node representing a parameter for a function with no body.
751
+ */
752
+ class BodyLessParameterNodeImpl extends Node , TBodyLessParameterNodeImpl {
753
+ Parameter p ;
754
+ int indirectionIndex ;
755
+
756
+ BodyLessParameterNodeImpl ( ) { this = TBodyLessParameterNodeImpl ( p , indirectionIndex ) }
757
+
758
+ override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
759
+
760
+ override Declaration getFunction ( ) { result = p .getFunction ( ) }
761
+
762
+ int getIndirectionIndex ( ) { result = indirectionIndex }
763
+
764
+ override DataFlowType getType ( ) {
765
+ result = getTypeImpl ( p .getUnderlyingType ( ) , this .getIndirectionIndex ( ) )
766
+ }
767
+
768
+ final override Location getLocationImpl ( ) {
769
+ result = unique( | | p .getLocation ( ) )
770
+ or
771
+ count ( p .getLocation ( ) ) != 1 and
772
+ result instanceof UnknownDefaultLocation
773
+ }
774
+
775
+ final override string toStringImpl ( ) {
776
+ exists ( string prefix | prefix = stars ( this ) | result = prefix + p .toString ( ) )
777
+ }
778
+ }
779
+
740
780
/**
741
781
* A data-flow node used to model flow summaries. That is, a dataflow node
742
782
* that is synthesized to represent a parameter, return value, or other part
0 commit comments