aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-01-17 22:54:23 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-01-17 22:54:23 +0000
commita68ad5bdee43a9796ae1f0f324508a5bff4f7cb0 (patch)
treee1f075186f74de41949ee32a597ec75cc91eb112 /gcc/cp/tree.c
parente41e26be41ba7e39df1dff5ef47f9a06a55281cc (diff)
downloadgcc-a68ad5bdee43a9796ae1f0f324508a5bff4f7cb0.zip
gcc-a68ad5bdee43a9796ae1f0f324508a5bff4f7cb0.tar.gz
gcc-a68ad5bdee43a9796ae1f0f324508a5bff4f7cb0.tar.bz2
cp-tree.h (build_shared_int_cst): New function.
* cp-tree.h (build_shared_int_cst): New function. * call.c (build_over_call): Use DECL_VIRTUAL_CONTEXT, for clarity. * class.c (modify_vtable_entry): Likewise. (add_virtual_function): Split out code to generated shared INTEGER_CSTs to build_share_int_cst. (modify_all_vtables): Handle all the overridden functions here. Add overridden functions from non-primary virtual bases to the primary vtable. (finish_struct_1): Adjust call to modify_all_vtables. Add overridden functions from non-primary bases to the vtable. * tree.c (build_shared_int_cst): New function. From-SVN: r31476
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 3c342d5..3bf874a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1,5 +1,5 @@
/* Language-dependent node constructors for parse phase of GNU compiler.
- Copyright (C) 1987, 88, 92-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92-98, 1999, 2000 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@@ -1710,6 +1710,26 @@ build_min VPROTO((enum tree_code code, tree tt, ...))
return t;
}
+/* Returns an INTEGER_CST (of type `int') corresponding to I.
+ Multiple calls with the same value of I may or may not yield the
+ same node; therefore, callers should never modify the node
+ returned. */
+
+tree
+build_shared_int_cst (i)
+ int i;
+{
+ static tree cache[256];
+
+ if (i >= 256)
+ return build_int_2 (i, 0);
+
+ if (!cache[i])
+ cache[i] = build_int_2 (i, 0);
+
+ return cache[i];
+}
+
tree
get_type_decl (t)
tree t;