- case OFFSET_TYPE:
- return ptm_initializer (var_desc, type);
- case POINTER_TYPE:
- return ptr_initializer (var_desc, type);
- case ENUMERAL_TYPE:
- return generic_initializer (var_desc, type);
- break;
- case FUNCTION_TYPE:
- return generic_initializer (var_desc, type);
- break;
- case ARRAY_TYPE:
- return generic_initializer (var_desc, type);
- break;
- case UNION_TYPE:
- case RECORD_TYPE:
- if (TYPE_PTRMEMFUNC_P (type))
- return ptm_initializer (var_desc, type);
- else if (var_desc == class_desc_type_node)
- return class_initializer (var_desc, type, NULL_TREE);
- else if (var_desc == si_class_desc_type_node)
- {
- tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), 0);
- tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
- tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE);
-
- return class_initializer (var_desc, type, base_inits);
- }
- else
- {
- int hint = ((CLASSTYPE_REPEATED_BASE_P (type) << 0)
- | (CLASSTYPE_DIAMOND_SHAPED_P (type) << 1));
- tree binfo = TYPE_BINFO (type);
- int nbases = BINFO_N_BASE_BINFOS (binfo);
- VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo);
- tree base_inits = NULL_TREE;
- int ix;
-
- /* Generate the base information initializer. */
- for (ix = nbases; ix--;)
- {
- tree base_binfo = BINFO_BASE_BINFO (binfo, ix);
- tree base_init = NULL_TREE;
- int flags = 0;
- tree tinfo;
- tree offset;
-
- if (VEC_index (tree, base_accesses, ix) == access_public_node)
- flags |= 2;
- tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
- if (BINFO_VIRTUAL_P (base_binfo))
- {
- /* We store the vtable offset at which the virtual
- base offset can be found. */
- offset = BINFO_VPTR_FIELD (base_binfo);
- offset = convert (sizetype, offset);
- flags |= 1;
- }
- else
- offset = BINFO_OFFSET (base_binfo);
-
- /* Combine offset and flags into one field. */
- offset = cp_build_binary_op (LSHIFT_EXPR, offset,
- build_int_cst (NULL_TREE, 8));
- offset = cp_build_binary_op (BIT_IOR_EXPR, offset,
- build_int_cst (NULL_TREE, flags));
- base_init = tree_cons (NULL_TREE, offset, base_init);
- base_init = tree_cons (NULL_TREE, tinfo, base_init);
- base_init = build_constructor (NULL_TREE, base_init);
- base_inits = tree_cons (NULL_TREE, base_init, base_inits);
- }
- base_inits = build_constructor (NULL_TREE, base_inits);
- base_inits = tree_cons (NULL_TREE, base_inits, NULL_TREE);
- /* Prepend the number of bases. */
- base_inits = tree_cons (NULL_TREE,
- build_int_cst (NULL_TREE, nbases),
- base_inits);
- /* Prepend the hint flags. */
- base_inits = tree_cons (NULL_TREE,
- build_int_cst (NULL_TREE, hint),
- base_inits);
-
- return class_initializer (var_desc, type, base_inits);
- }
- break;
+ case TK_POINTER_MEMBER_TYPE:
+ return ptm_initializer (ti, type);
+
+ case TK_POINTER_TYPE:
+ return ptr_initializer (ti, type);
+
+ case TK_BUILTIN_TYPE:
+ case TK_ENUMERAL_TYPE:
+ case TK_FUNCTION_TYPE:
+ case TK_ARRAY_TYPE:
+ return generic_initializer (ti, type);
+
+ case TK_CLASS_TYPE:
+ return class_initializer (ti, type, NULL_TREE);
+
+ case TK_SI_CLASS_TYPE:
+ {
+ tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), 0);
+ tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
+ tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE);
+
+ /* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
+ ti = VEC_index (tinfo_s, tinfo_descs, tk_index);
+ return class_initializer (ti, type, base_inits);
+ }