aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-01-31 21:00:01 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-01-31 21:00:01 +0000
commit5e19c0539080471ad7097fa5c441031334f12bdd (patch)
tree9d11b66fb3519c817dc45d1c1ad7fdca554ed8ed /gcc/cp/tree.c
parentd4cf5733ee1a1e5efded2df9800e6edd64a944bd (diff)
downloadgcc-5e19c0539080471ad7097fa5c441031334f12bdd.zip
gcc-5e19c0539080471ad7097fa5c441031334f12bdd.tar.gz
gcc-5e19c0539080471ad7097fa5c441031334f12bdd.tar.bz2
cp-tree.h (BINFO_VIRTUALS): Tweak documentation.
* cp-tree.h (BINFO_VIRTUALS): Tweak documentation. (CLASSTYPE_PRIMARY_BINFO): Use BINFO_PRIMARY_BINFO. (BINFO_PRIMARY_BINFO): New macro. (BF_DELTA): Rename to ... (BV_DELTA): ... this. (BF_VCALL_INDEX): Rename to ... (BV_VCALL_INDEX): ... this. (BF_FN): Rename to ... (BV_FN): ... this. * class.c (build_vbase_path): Adjust for changes to reverse_path. (set_rtti_entry): Rename BF_ macros to BV_ variants. (modify_vtable_entry): Simplify. (add_virtual_function): Rename BF_ macros to BV_ variants. (build_vtable_initializer): Likewise. (get_class_offset_1): Remove. (dfs_get_class_offset): Likewise. (get_class_offset): Likewise. (dfs_find_final_overrider): New function. (find_final_overrider): Likewise. (modify_one_vtable): Remove. (dfs_find_base): New function. (dfs_modify_vtables): Fold modify_one_vtable in here. Use find_final_overrider. (modify_all_vtables): Adjust. Set BV_VCALL_INDEX on new virtuals. (dfs_fixup_vtable_deltas): Remove. (override_one_vtable): Remove. (merge_overrides): Likewise. (layout_virtual_bases): Make sure BINFO_OFFSET is set right for unreal chilren of virtual bases. (finish_struct_1): Don't use merge_overrides. Don't use dfs_fixup_vtable_deltas. * tree.c (reverse_path): Return a TREE_LIST, not a chain of BINFOs. From-SVN: r31724
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 392ea54..a66a634 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -883,23 +883,26 @@ binfo_value (elem, type)
return get_binfo (elem, type, 0);
}
-/* Return a reversed copy of the BINFO-chain given by PATH. (If the
- BINFO_INHERITANCE_CHAIN points from base classes to derived
- classes, it will instead point from derived classes to base
- classes.) Returns the first node in the reversed chain. */
+/* Return a TREE_LIST whose TREE_VALUE nodes along the
+ BINFO_INHERITANCE_CHAIN for BINFO, but in the opposite order. In
+ other words, while the BINFO_INHERITANCE_CHAIN goes from base
+ classes to derived classes, the reversed path goes from derived
+ classes to base classes. */
tree
-reverse_path (path)
- tree path;
+reverse_path (binfo)
+ tree binfo;
{
- register tree prev = NULL_TREE, cur;
- for (cur = path; cur; cur = BINFO_INHERITANCE_CHAIN (cur))
+ tree reversed_path;
+
+ reversed_path = NULL_TREE;
+ while (binfo)
{
- tree r = copy_node (cur);
- BINFO_INHERITANCE_CHAIN (r) = prev;
- prev = r;
+ reversed_path = tree_cons (NULL_TREE, binfo, reversed_path);
+ binfo = BINFO_INHERITANCE_CHAIN (binfo);
}
- return prev;
+
+ return reversed_path;
}
void