8bce5533
by Elizabeth Figura at 2024-08-12T12:37:26+02:00
widl: Propagate attrs to inner pointer types.
Some attributes, namely [iid_is], [string], [switch_is], and [switch_type],
apply to the innermost type. That is, when specified on a top-level parameter
like
int func(..., [iid_is(...)] void ****arg);
the innermost pointee ***arg must have an iid type.
At the same time, the pointer type attributes [ref], [unique], [ptr] must *only*
apply to the top-level pointer. Inner pointers have the default pointer type.
In order to implement this, we always pass "attrs" to inner array and pointer
types, and we also pass around an extra parameter "toplevel_attrs" which
signifies whether the passed-in attributes should be applied directly to this
type (having come from a parameter, field, or typedef), or whether they were
inherited from a higher-level pointer.