@@ -108,6 +108,20 @@ class FunctionInput extends TFunctionInput {
108108 predicate isQualifierAddress ( ) { none ( ) }
109109}
110110
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+ */
111125class InParameter extends FunctionInput , TInParameter {
112126 ParameterIndex index ;
113127
@@ -121,6 +135,21 @@ class InParameter extends FunctionInput, TInParameter {
121135 override predicate isParameter ( ParameterIndex i ) { i = index }
122136}
123137
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+ */
124153class InParameterDeref extends FunctionInput , TInParameterDeref {
125154 ParameterIndex index ;
126155
@@ -134,12 +163,36 @@ class InParameterDeref extends FunctionInput, TInParameterDeref {
134163 override predicate isParameterDeref ( ParameterIndex i ) { i = index }
135164}
136165
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+ */
137178class InQualifierObject extends FunctionInput , TInQualifierObject {
138179 override string toString ( ) { result = "InQualifierObject" }
139180
140181 override predicate isQualifierObject ( ) { any ( ) }
141182}
142183
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+ */
143196class InQualifierAddress extends FunctionInput , TInQualifierAddress {
144197 override string toString ( ) { result = "InQualifierAddress" }
145198
@@ -265,6 +318,21 @@ class FunctionOutput extends TFunctionOutput {
265318 deprecated final predicate isOutReturnPointer ( ) { isReturnValueDeref ( ) }
266319}
267320
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+ */
268336class OutParameterDeref extends FunctionOutput , TOutParameterDeref {
269337 ParameterIndex index ;
270338
@@ -277,18 +345,62 @@ class OutParameterDeref extends FunctionOutput, TOutParameterDeref {
277345 override predicate isParameterDeref ( ParameterIndex i ) { i = index }
278346}
279347
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+ */
280360class OutQualifierObject extends FunctionOutput , TOutQualifierObject {
281361 override string toString ( ) { result = "OutQualifierObject" }
282362
283363 override predicate isQualifierObject ( ) { any ( ) }
284364}
285365
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+ */
286382class OutReturnValue extends FunctionOutput , TOutReturnValue {
287383 override string toString ( ) { result = "OutReturnValue" }
288384
289385 override predicate isReturnValue ( ) { any ( ) }
290386}
291387
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+ */
292404class OutReturnValueDeref extends FunctionOutput , TOutReturnValueDeref {
293405 override string toString ( ) { result = "OutReturnValueDeref" }
294406
0 commit comments