This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcjx] Patch: FYI: strip abstract methods


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];
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]