+ for (predef_struct = &psi_predef_structs[0]; predef_struct->type_tag; ++predef_struct) {
+ struct psi_predef_struct *member;
+ decl_args *dargs = init_decl_args(NULL);
+ decl_struct *dstruct = init_decl_struct(predef_struct->var_name, dargs);
+
+ dstruct->size = predef_struct->size;
+ dstruct->align = predef_struct->offset;
+ for (member = &predef_struct[1]; member->type_tag; ++member) {
+ decl_type *type;
+ decl_var *dvar;
+ decl_arg *darg;
+
+ type = init_decl_type(member->type_tag, member->type_name);
+ dvar = init_decl_var(member->var_name, member->pointer_level, member->array_size);
+ darg = init_decl_arg(type, dvar);
+ darg->layout = init_decl_struct_layout(member->offset, member->size);
+ dargs = add_decl_arg(dargs, darg);
+ }
+
+ T.structs = add_decl_struct(T.structs, dstruct);
+ predef_struct = member;
+ }
+ for (predef_union = &psi_predef_unions[0]; predef_union->type_tag; ++predef_union) {
+ struct psi_predef_union *member;
+ decl_args *dargs = init_decl_args(NULL);
+ decl_union *dunion = init_decl_union(predef_union->var_name, dargs);
+
+ dunion->size = predef_union->size;
+ dunion->align = predef_union->offset;
+ for (member = &predef_union[1]; member->type_tag; ++member) {
+ decl_type *type;
+ decl_var *dvar;
+ decl_arg *darg;
+
+ type = init_decl_type(member->type_tag, member->type_name);
+ dvar = init_decl_var(member->var_name, member->pointer_level, member->array_size);
+ darg = init_decl_arg(type, dvar);
+ darg->layout = init_decl_struct_layout(member->offset, member->size);
+ dargs = add_decl_arg(dargs, darg);
+ }
+
+ T.unions = add_decl_union(T.unions, dunion);
+ predef_union = member;
+ }
+ for (predef_decl = &psi_predef_decls[0]; predef_decl->type_tag; ++predef_decl) {
+ struct psi_predef_decl *farg;
+ decl_type *ftype = init_decl_type(predef_decl->type_tag, predef_decl->type_name);
+ decl_var *fname = init_decl_var(predef_decl->var_name, predef_decl->pointer_level, predef_decl->array_size);
+ decl_arg *func = init_decl_arg(ftype, fname);
+ decl_args *args = init_decl_args(NULL);
+ decl *decl = init_decl(init_decl_abi("default"), func, args);
+
+ for (farg = &predef_decl[1]; farg->type_tag; ++farg) {
+ decl_type *arg_type = init_decl_type(farg->type_tag, farg->type_name);
+ decl_var *arg_var = init_decl_var(farg->var_name, farg->pointer_level, farg->array_size);
+ decl_arg *darg = init_decl_arg(arg_type, arg_var);
+ args = add_decl_arg(args, darg);
+ }
+
+ T.decls = add_decl(T.decls, decl);
+ predef_decl = farg;
+ }
+
+ for (predef_decl = &psi_predef_vararg_decls[0]; predef_decl->type_tag; ++predef_decl) {
+ struct psi_predef_decl *farg;
+ decl_type *ftype = init_decl_type(predef_decl->type_tag, predef_decl->type_name);
+ decl_var *fname = init_decl_var(predef_decl->var_name, predef_decl->pointer_level, predef_decl->array_size);
+ decl_arg *func = init_decl_arg(ftype, fname);
+ decl_args *args = init_decl_args(NULL);
+ decl *decl = init_decl(init_decl_abi("default"), func, args);
+
+ for (farg = &predef_decl[1]; farg->type_tag; ++farg) {
+ decl_type *arg_type = init_decl_type(farg->type_tag, farg->type_name);
+ decl_var *arg_var = init_decl_var(farg->var_name, farg->pointer_level, farg->array_size);
+ decl_arg *darg = init_decl_arg(arg_type, arg_var);
+ args = add_decl_arg(args, darg);
+ }
+ args->varargs = 1;
+
+ T.decls = add_decl(T.decls, decl);
+ predef_decl = farg;
+ }
+
+ PSI_ContextValidateData(PSI_DATA(C), &T);
+
+ C->count = 1;
+ C->data = malloc(sizeof(*C->data));
+ PSI_DataExchange(C->data, &T);
+