Skip to content

Commit

Permalink
2000-07-27 Tom Tromey <tromey@cygnus.com>
Browse files Browse the repository at this point in the history
            Anthony Green  <green@cygnus.com>
	    Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* class.c (make_class_data): Create vtable for abstract classes.
	(get_dispatch_table): Changed to cope with abstract classes.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35313 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
tromey committed Jul 28, 2000
1 parent dcc1e6a commit 1d47a66
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
7 changes: 7 additions & 0 deletions gcc/java/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2000-07-27 Tom Tromey <tromey@cygnus.com>
Anthony Green <green@cygnus.com>
Alexandre Petit-Bianco <apbianco@cygnus.com>

* class.c (make_class_data): Create vtable for abstract classes.
(get_dispatch_table): Changed to cope with abstract classes.

2000-07-27 Tom Tromey <tromey@cygnus.com>

* parse.y (patch_method_invocation): Don't reverse the argument
Expand Down
21 changes: 15 additions & 6 deletions gcc/java/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ static tree
get_dispatch_table (type, this_class_addr)
tree type, this_class_addr;
{
int abstract_p = CLASS_ABSTRACT (TYPE_NAME (type));
tree vtable = get_dispatch_vector (type);
int i;
tree list = NULL_TREE;
Expand All @@ -1226,12 +1227,20 @@ get_dispatch_table (type, this_class_addr)
{
tree method = TREE_VEC_ELT (vtable, i);
if (METHOD_ABSTRACT (method))
warning_with_decl (method, "abstract method in non-abstract class");
if (DECL_RTL (method) == 0)
make_decl_rtl (method, NULL, 1);
{
if (! abstract_p)
warning_with_decl (method,
"abstract method in non-abstract class");
method = null_pointer_node;
}
else
{
if (DECL_RTL (method) == 0)
make_decl_rtl (method, NULL, 1);
method = build1 (ADDR_EXPR, nativecode_ptr_type_node, method);
}
list = tree_cons (NULL_TREE /*DECL_VINDEX (method) + 2*/,
build1 (ADDR_EXPR, nativecode_ptr_type_node, method),
list);
method, list);
}
/* Dummy entry for compatibility with G++ -fvtable-thunks. When
using the Boehm GC we sometimes stash a GC type descriptor
Expand Down Expand Up @@ -1345,7 +1354,7 @@ make_class_data (type)
rest_of_decl_compilation (methods_decl, (char*) 0, 1, 0);

if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (type_decl)))
&& ! CLASS_ABSTRACT (type_decl) && ! CLASS_INTERFACE (type_decl))
&& ! CLASS_INTERFACE (type_decl))
{
tree dtable = get_dispatch_table (type, this_class_addr);
dtable_decl = build_dtable_decl (type);
Expand Down

0 comments on commit 1d47a66

Please sign in to comment.