+
+ if (real->type == PSI_T_UNION) {
+ struct psi_decl_arg *arg;
+ psi_plist_get(real->real.unn->args, 0, &arg);
+ return psi_context_decl_arg_full_type(C, arg);
+ }
+
+ if (real->type == PSI_T_STRUCT) {
+ C->ops->composite_init(C, darg);
+ return darg->engine.type;
+ }
+
+ return C->ops->typeof_decl(C, real->type);
+}
+
+void *psi_context_decl_arg_call_type(struct psi_context *C,
+ struct psi_decl_arg *darg)
+{
+ if (darg->var->pointer_level) {
+ return C->ops->typeof_decl(C, PSI_T_POINTER);
+ }
+
+ return psi_context_decl_arg_type(C, darg);
+}
+
+void *psi_context_decl_arg_full_type(struct psi_context *C,
+ struct psi_decl_arg *darg)
+{
+ if (darg->var->array_size) {
+ C->ops->composite_init(C, darg);
+ return darg->engine.type;
+ }
+ if (darg->var->pointer_level) {
+ return C->ops->typeof_decl(C, PSI_T_POINTER);
+ }
+
+ return psi_context_decl_arg_type(C, darg);
+}
+
+void **psi_context_composite_type_elements(struct psi_context *C,
+ struct psi_decl_arg *darg, struct psi_plist **eles)
+{
+ struct psi_decl_type *dtype;
+ struct psi_decl_arg *tmp;
+ void *type, *copy;
+
+ dtype = psi_decl_type_get_real(darg->type);
+
+ switch (dtype->type) {
+ case PSI_T_STRUCT:
+ psi_context_decl_struct_type_elements(C, dtype->real.strct, eles);
+ break;
+ case PSI_T_UNION:
+ if (psi_plist_bottom(dtype->real.unn->args, &tmp)) {
+ type = psi_context_decl_arg_full_type(C, tmp);
+ copy = C->ops->copyof_type(C, type);
+ *eles = psi_plist_add(*eles, ©);
+ }
+ break;
+ default:
+ type = psi_context_decl_arg_type(C, darg);
+ for (size_t i = 0; i < darg->var->array_size; ++i) {
+ copy = C->ops->copyof_type(C, type);
+ *eles = psi_plist_add(*eles, ©);