@@ -54,6 +54,20 @@ signature module InputSig<LocationSig Location, DF::InputSig<Location> Lang> {
54
54
/** Gets the return kind corresponding to specification `"ReturnValue"`. */
55
55
Lang:: ReturnKind getStandardReturnValueKind ( ) ;
56
56
57
+ /**
58
+ * Gets the return kind corresponding to specification `"ReturnValue"` when
59
+ * the supplied argument `arg`.
60
+ *
61
+ * Note that it is expected that the following equality holds:
62
+ * ```
63
+ * getReturnValueKind("") = getStandardReturnValueKind()
64
+ * ```
65
+ */
66
+ default Lang:: ReturnKind getReturnValueKind ( string arg ) {
67
+ arg = "" and
68
+ result = getStandardReturnValueKind ( )
69
+ }
70
+
57
71
/** Gets the textual representation of parameter position `pos` used in MaD. */
58
72
string encodeParameterPosition ( Lang:: ParameterPosition pos ) ;
59
73
@@ -2164,9 +2178,15 @@ module Make<
2164
2178
)
2165
2179
)
2166
2180
or
2167
- c = "ReturnValue" and
2168
- node .asNode ( ) =
2169
- getAnOutNodeExt ( mid .asCall ( ) , TValueReturn ( getStandardReturnValueKind ( ) ) )
2181
+ c .getName ( ) = "ReturnValue" and
2182
+ exists ( ReturnKind rk |
2183
+ not exists ( c .getAnArgument ( ) ) and
2184
+ rk = getStandardReturnValueKind ( )
2185
+ or
2186
+ rk = getReturnValueKind ( c .getAnArgument ( ) )
2187
+ |
2188
+ node .asNode ( ) = getAnOutNodeExt ( mid .asCall ( ) , TValueReturn ( rk ) )
2189
+ )
2170
2190
or
2171
2191
SourceSinkInterpretationInput:: interpretOutput ( c , mid , node )
2172
2192
)
@@ -2198,12 +2218,16 @@ module Make<
2198
2218
)
2199
2219
)
2200
2220
or
2201
- exists ( ReturnNode ret , ValueReturnKind kind |
2202
- c = "ReturnValue" and
2221
+ exists ( ReturnNode ret , ReturnKind kind |
2222
+ c . getName ( ) = "ReturnValue" and
2203
2223
ret = node .asNode ( ) and
2204
- kind .getKind ( ) = ret .getKind ( ) and
2205
- kind .getKind ( ) = getStandardReturnValueKind ( ) and
2224
+ kind = ret .getKind ( ) and
2206
2225
mid .asCallable ( ) = getNodeEnclosingCallable ( ret )
2226
+ |
2227
+ not exists ( c .getAnArgument ( ) ) and
2228
+ kind = getStandardReturnValueKind ( )
2229
+ or
2230
+ kind = getReturnValueKind ( c .getAnArgument ( ) )
2207
2231
)
2208
2232
or
2209
2233
SourceSinkInterpretationInput:: interpretInput ( c , mid , node )
0 commit comments