This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: strip abstract methods
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 23 Mar 2005 19:07:35 -0700
- Subject: [gcjx] Patch: FYI: strip abstract methods
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
This follows up the gcjx patch from a few days ago.
If we see a "fake" abstract method (for instance created by a call to
one of two inherited abstract methods), we instead map to the actual
underlying method. It was simpler to go this route than to figure
out how to represent and register these phony methods.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* builtins.cc (map_method): Strip abstract methods.
Index: builtins.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/builtins.cc,v
retrieving revision 1.1.2.22
diff -u -r1.1.2.22 builtins.cc
--- builtins.cc 24 Mar 2005 02:08:15 -0000 1.1.2.22
+++ builtins.cc 24 Mar 2005 02:08:58 -0000
@@ -342,6 +342,14 @@
tree
tree_builtins::map_method (model_method *meth)
{
+ // An abstract method can itself be derived from an abstract method.
+ // We strip them all off to get the method as actually declared.
+ while (dynamic_cast<model_abstract_method *> (meth))
+ {
+ model_abstract_method *mam = assert_cast<model_abstract_method *> (meth);
+ meth = mam->get_original ();
+ }
+
assert (methodmap.find (meth) != methodmap.end ());
return methodmap[meth];
}