@@ -218,20 +218,17 @@ class ClassAggregateLiteral extends AggregateLiteral {
218
218
219
219
/**
220
220
* Holds if the `position`-th initialization of `field` in this aggregate initializer
221
- * uses a designator (e.g., `.x =`, `[42] = `) rather than a positional initializer.
221
+ * uses a designated (e.g., `.x = ... `) rather than a positional initializer.
222
222
*
223
- * This can be used to distinguish explicitly designated initializations from
224
- * implicit positional ones.
225
- *
226
- * For example, in the initializer:
223
+ * For example, in:
227
224
* ```c
228
225
* struct S { int x, y; };
229
226
* struct S s = { .x = 1, 2 };
230
227
* ```
231
- * - `.x = 1` is a designator init , therefore `isDesignatorInit (x, 0)` holds.
232
- * - `2` is a positional init for `.y`, therefore `isDesignatorInit (y, 1)` does ** not** hold.
228
+ * - `.x = 1` is a designated initializer , therefore `hasDesignator (x, 0)` holds.
229
+ * - `2` is a positional initializer for `s .y`, therefore `hasDesignator (y, 1)` does not hold.
233
230
*/
234
- predicate isDesignatorInit ( Field field , int position ) {
231
+ predicate hasDesignator ( Field field , int position ) {
235
232
field = classType .getAField ( ) and
236
233
aggregate_field_init ( underlyingElement ( this ) , _, unresolveElement ( field ) , position , true )
237
234
}
@@ -330,17 +327,17 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral {
330
327
331
328
/**
332
329
* Holds if the `position`-th initialization of the array element at `elementIndex`
333
- * in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than
334
- * an implicit positional initializer.
330
+ * in this aggregate initializer uses a designated (e.g., `[0] = ...`) rather than
331
+ * a positional initializer.
335
332
*
336
333
* For example, in:
337
334
* ```c
338
335
* int x[] = { [0] = 1, 2 };
339
336
* ```
340
- * - `[0] = 1` is a designator init , therefore `isDesignatorInit (0, 0)` holds.
341
- * - `2` is a positional init for `x[1]`, therefore `isDesignatorInit (1, 1)` does ** not** hold.
337
+ * - `[0] = 1` is a designated initializer , therefore `hasDesignator (0, 0)` holds.
338
+ * - `2` is a positional initializer for `x[1]`, therefore `hasDesignator (1, 1)` does not hold.
342
339
*/
343
- predicate isDesignatorInit ( int elementIndex , int position ) {
340
+ predicate hasDesignator ( int elementIndex , int position ) {
344
341
aggregate_array_init ( underlyingElement ( this ) , _, elementIndex , position , true )
345
342
}
346
343
0 commit comments