diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-07-20 12:26:02 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-07-20 12:26:02 +0000 |
commit | fa743e8cda25ba09a4731a3443df9e0e56e87581 (patch) | |
tree | d4f6d97c6ff518d744dc34b2b6c955e9348bb0b0 /gcc/doc/c-tree.texi | |
parent | 35ae2ed81410448471c46f7757e6bc879d4de250 (diff) | |
download | gcc-fa743e8cda25ba09a4731a3443df9e0e56e87581.tar.gz |
tree.h: Include vec.h
.: * tree.h: Include vec.h
(DEF_VEC_P(tree)): New type.
(BINFO_BASE_BINFOS, BINFO_N_BASE_BINFOS, BINFO_BASE_BINFO): Adjust.
(BINFO_BASE_APPEND, BINFO_BASE_ITERATE): New.
(BINFO_LANG_SLOT): Remove.
(BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): New.
(struct tree_binfo): Turn base_binfos into a trailing
VEC(tree). Add vtt_subvtt, vtt_vptr, primary fields.
(binfo_lang_slots): Remove.
* tree.c (binfo_lang_slots): Remove.
(make_tree_binfo_stat): Take a base binfo count, not a
lang slot count. Adjust.
* Makefile.in (TREE_H): Add vec.h
* alias.c (record_component_aliases): Adjust BINFO access.
* dbxout.c (dbxout_type): Likewise.
* dwarf2out.c (gen_member_die): Likewise.
* sdbout.c (sdbout_one_type): Likewise.
* tree-dump.c (deque_and_dump): Likewise.
* config/i386/i386.c (classify_argument,
contains_128bit_aligned_vector_p): Likewise.
* config/sh/symbian.c (symbian_export_vtable_and_rtti_p): Likewise.
* doc/c-tree.texi (Classes): Update BINFO documentation.
cp:
* cp-tree.h (DEF_VEC_P(tree)): Remove here.
(BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
Moved to common.
(BINFO_LANG_SLOTS): Remove.
* tree.c (copy_binfo): Adjust BINFO creation and accessors.
* decl.c (xref_basetypes): Adjust BINFO creation and accessors.
* class.c (check_bases): Adjust BINFO accessors.
(determine_primary_base, finish_struct_bits,
maybe_warn_about_overly_private_class, warn_hidden,
walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
warn_about_ambiguous_bases, get_vfield_name,
dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
add_vcall_offset_vtbl_entries_r): Likewise.
* dump.c (cp_dump_tree): Likewise.
* init.c (sort_mem_initializers, expand_member_init, build_delete,
push_base_cleanups): Likewise.
* method.c (do_build_copy_constructor, do_build_assign_ref,
synthesize_exception_spec): Likewise.
name-lookup.c (arg_assoc_class): Likewise.
* pt.c (instantiate_class_template,
get_template_base_recursive): Likewise.
* rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
* typeck2.c (process_init_constructor): Likewise.
* search.c (lookup_base_r, dynamic_cast_base_recurse,
dfs_access_in_type, dfs_walk_real, look_for_overrides,
types_overlap_p, copied_binfo, original_binfo): Likewise.
(binfo_for_vtable): Remove
java:
* class.c (add_interface_do): Remove.
(set_super_info, interface_of_p, maybe_add_interface,
add_interface, make_class_data, layout_class,
add_miranda_methods): Adjust BINFO accessors and addition.
* expr.c (can_widen_reference_to, lookup_field): Adjust BINFO
accessors.
* jcf-write.c (generate_classfile): Likewise.
* parse.y (patch_anonymous_class, check_inner_circular_reference,
check_circular_reference, java_complete_class,
check_abstract_method_definitions,
java_check_abstract_method_definitions,
check_interface_throws_clauses, java_check_abstract_methods,
lookup_java_interface_method2,
find_applicable_accessible_methods_list): Adjust BINFO accessors
and addition.
* typeck.c (find_method_in_interfaces): Adjust BINFO accessors.
From-SVN: r84949
Diffstat (limited to 'gcc/doc/c-tree.texi')
-rw-r--r-- | gcc/doc/c-tree.texi | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi index f25c8fb006a..f9509e44c6e 100644 --- a/gcc/doc/c-tree.texi +++ b/gcc/doc/c-tree.texi @@ -747,32 +747,33 @@ list. Implicitly declared functions (including default constructors, copy constructors, assignment operators, and destructors) will appear on this list as well. -@c under reconstruction 2004-07-01, FIXME:Nathan Sidwell -[Binfos are being redesigned, this information is in a state of flux.] Every class has an associated @dfn{binfo}, which can be obtained with @code{TYPE_BINFO}. Binfos are used to represent base-classes. The binfo given by @code{TYPE_BINFO} is the degenerate case, whereby every -class is considered to be its own base-class. The base classes for a -particular binfo can be obtained with @code{BINFO_BASETYPES}. These -base-classes are themselves binfos. The class type associated with a -binfo is given by @code{BINFO_TYPE}. It is always the case that -@code{BINFO_TYPE (TYPE_BINFO (x))} is the same type as @code{x}, up to -qualifiers. However, it is not always the case that @code{TYPE_BINFO -(BINFO_TYPE (y))} is always the same binfo as @code{y}. The reason is -that if @code{y} is a binfo representing a base-class @code{B} of a -derived class @code{D}, then @code{BINFO_TYPE (y)} will be @code{B}, -and @code{TYPE_BINFO (BINFO_TYPE (y))} will be @code{B} as its own -base-class, rather than as a base-class of @code{D}. - -The @code{BINFO_BASETYPES} is a @code{TREE_VEC} (@pxref{Containers}). -Base types appear in left-to-right order in this vector. You can tell -whether or @code{public}, @code{protected}, or @code{private} -inheritance was used by using the @code{TREE_VIA_PUBLIC}, -@code{TREE_VIA_PROTECTED}, and @code{TREE_VIA_PRIVATE} macros. Each of -these macros takes a @code{BINFO} and is true if and only if the -indicated kind of inheritance was used. If @code{TREE_VIA_VIRTUAL} -holds of a binfo, then its @code{BINFO_TYPE} was inherited from -virtually. +class is considered to be its own base-class. The base binfos for a +particular binfo are held in a vector, whose length is obtained with +@code{BINFO_N_BASE_BINFOS}. The base binfos themselves are obtained +with @code{BINFO_BASE_BINFO} and @code{BINFO_BASE_ITERATE}. To add a +new binfo, use @code{BINFO_BASE_APPEND}. The vector of base binfos can +be obtained with @code{BINFO_BASE_BINFOS}, but normally you do not need +to use that. The class type associated with a binfo is given by +@code{BINFO_TYPE}. It is not always the case that @code{BINFO_TYPE +(TYPE_BINFO (x))}, because of typedefs and qualified types. Neither is +it the case that @code{TYPE_BINFO (BINFO_TYPE (y))} is the same binfo as +@code{y}. The reason is that if @code{y} is a binfo representing a +base-class @code{B} of a derived class @code{D}, then @code{BINFO_TYPE +(y)} will be @code{B}, and @code{TYPE_BINFO (BINFO_TYPE (y))} will be +@code{B} as its own base-class, rather than as a base-class of @code{D}. + +The access to a base type can be found with @code{BINFO_BASE_ACCESS}. +This will produce @code{access_public_node}, @code{access_private_node} +or @code{access_protected_node}. If bases are always public, +@code{BINFO_BASE_ACCESSES} may be @code{NULL}. + +@code{BINFO_VIRTUAL_P} is used to specify whether the binfo is inherited +virtually or not. The other flags, @code{BINFO_MARKED_P} and +@code{BINFO_FLAG_1} to @code{BINFO_FLAG_6} can be used for language +specific use. The following macros can be used on a tree node representing a class-type. |