@@ -108,6 +108,20 @@ class FunctionInput extends TFunctionInput {
108
108
predicate isQualifierAddress ( ) { none ( ) }
109
109
}
110
110
111
+ /**
112
+ * The input value of a parameter.
113
+ *
114
+ * Example:
115
+ * ```
116
+ * void func(int n, char* p, float& r);
117
+ * ```
118
+ * - There is an `InParameter` representing the value of `n` (with type `int`) on entry to the
119
+ * function.
120
+ * - There is an `InParameter` representing the value of `p` (with type `char*`) on entry to the
121
+ * function.
122
+ * - There is an `InParameter` representing the "value" of the reference `r` (with type `float&`) on
123
+ * entry to the function, _not_ the value of the referred-to `float`.
124
+ */
111
125
class InParameter extends FunctionInput , TInParameter {
112
126
ParameterIndex index ;
113
127
@@ -121,6 +135,21 @@ class InParameter extends FunctionInput, TInParameter {
121
135
override predicate isParameter ( ParameterIndex i ) { i = index }
122
136
}
123
137
138
+ /**
139
+ * The input value pointed to by a pointer parameter to a function, or the input value referred to
140
+ * by a reference parameter to a function.
141
+ *
142
+ * Example:
143
+ * ```
144
+ * void func(int n, char* p, float& r);
145
+ * ```
146
+ * - There is an `InParameterDeref` with `getIndex() = 1` that represents the value of `*p` (with
147
+ * type `char`) on entry to the function.
148
+ * - There is an `InParameterDeref` with `getIndex() = 2` that represents the value of `r` (with
149
+ * type `float`) on entry to the function.
150
+ * - There is no `InParameterDeref` representing the value of `n`, because `n` is neither a pointer
151
+ * nor a reference.
152
+ */
124
153
class InParameterDeref extends FunctionInput , TInParameterDeref {
125
154
ParameterIndex index ;
126
155
@@ -134,12 +163,36 @@ class InParameterDeref extends FunctionInput, TInParameterDeref {
134
163
override predicate isParameterDeref ( ParameterIndex i ) { i = index }
135
164
}
136
165
166
+ /**
167
+ * The input value pointed to by the `this` pointer of an instance member function.
168
+ *
169
+ * Example:
170
+ * ```
171
+ * struct C {
172
+ * void mfunc(int n, char* p, float& r) const;
173
+ * };
174
+ * ```
175
+ * - `InQualifierObject` represents the value of `*this` (with type `C const`) on entry to the
176
+ * function.
177
+ */
137
178
class InQualifierObject extends FunctionInput , TInQualifierObject {
138
179
override string toString ( ) { result = "InQualifierObject" }
139
180
140
181
override predicate isQualifierObject ( ) { any ( ) }
141
182
}
142
183
184
+ /**
185
+ * The input value of the `this` pointer of an instance member function.
186
+ *
187
+ * Example:
188
+ * ```
189
+ * struct C {
190
+ * void mfunc(int n, char* p, float& r) const;
191
+ * };
192
+ * ```
193
+ * - `InQualifierAddress` represents the value of `this` (with type `C const *`) on entry to the
194
+ * function.
195
+ */
143
196
class InQualifierAddress extends FunctionInput , TInQualifierAddress {
144
197
override string toString ( ) { result = "InQualifierAddress" }
145
198
@@ -265,6 +318,21 @@ class FunctionOutput extends TFunctionOutput {
265
318
deprecated final predicate isOutReturnPointer ( ) { isReturnValueDeref ( ) }
266
319
}
267
320
321
+ /**
322
+ * The output value pointed to by a pointer parameter to a function, or the output value referred to
323
+ * by a reference parameter to a function.
324
+ *
325
+ * Example:
326
+ * ```
327
+ * void func(int n, char* p, float& r);
328
+ * ```
329
+ * - There is an `OutParameterDeref` with `getIndex()=1` that represents the value of `*p` (with
330
+ * type `char`) on return from the function.
331
+ * - There is an `OutParameterDeref` with `getIndex()=2` that represents the value of `r` (with
332
+ * type `float`) on return from the function.
333
+ * - There is no `OutParameterDeref` representing the value of `n`, because `n` is neither a
334
+ * pointer nor a reference.
335
+ */
268
336
class OutParameterDeref extends FunctionOutput , TOutParameterDeref {
269
337
ParameterIndex index ;
270
338
@@ -277,18 +345,62 @@ class OutParameterDeref extends FunctionOutput, TOutParameterDeref {
277
345
override predicate isParameterDeref ( ParameterIndex i ) { i = index }
278
346
}
279
347
348
+ /**
349
+ * The output value pointed to by the `this` pointer of an instance member function.
350
+ *
351
+ * Example:
352
+ * ```
353
+ * struct C {
354
+ * void mfunc(int n, char* p, float& r);
355
+ * };
356
+ * ```
357
+ * - The `OutQualifierObject` represents the value of `*this` (with type `C`) on return from the
358
+ * function.
359
+ */
280
360
class OutQualifierObject extends FunctionOutput , TOutQualifierObject {
281
361
override string toString ( ) { result = "OutQualifierObject" }
282
362
283
363
override predicate isQualifierObject ( ) { any ( ) }
284
364
}
285
365
366
+ /**
367
+ * The value returned by a function.
368
+ *
369
+ * Example:
370
+ * ```
371
+ * int getInt();
372
+ * char* getPointer();
373
+ * float& getReference();
374
+ * ```
375
+ * - `OutReturnValue` represents the value returned by
376
+ * `getInt()` (with type `int`).
377
+ * - `OutReturnValue` represents the value returned by
378
+ * `getPointer()` (with type `char*`).
379
+ * - `OutReturnValue` represents the "value" of the reference returned by `getReference()` (with
380
+ * type `float&`), _not_ the value of the referred-to `float`.
381
+ */
286
382
class OutReturnValue extends FunctionOutput , TOutReturnValue {
287
383
override string toString ( ) { result = "OutReturnValue" }
288
384
289
385
override predicate isReturnValue ( ) { any ( ) }
290
386
}
291
387
388
+ /**
389
+ * The output value pointed to by the return value of a function, if the function returns a pointer,
390
+ * or the output value referred to by the return value of a function, if the function returns a
391
+ * reference.
392
+ *
393
+ * Example:
394
+ * ```
395
+ * char* getPointer();
396
+ * float& getReference();
397
+ * int getInt();
398
+ * ```
399
+ * - `OutReturnValueDeref` represents the value of `*getPointer()` (with type `char`).
400
+ * - `OutReturnValueDeref` represents the value of `getReference()` (with type `float`).
401
+ * - `OutReturnValueDeref` does not represent the return value of `getInt()` because the return type
402
+ * of `getInt()` is neither a pointer nor a reference.
403
+ */
292
404
class OutReturnValueDeref extends FunctionOutput , TOutReturnValueDeref {
293
405
override string toString ( ) { result = "OutReturnValueDeref" }
294
406
0 commit comments