This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: lay out interfaces as well
- 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:04:44 -0700
- Subject: [gcjx] Patch: FYI: lay out interfaces as well
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
When laying out a class we must also lay out its interfaces.
Otherwise, we can end up referring to an unmapped method.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* builtins.cc (lay_out_class): Lay out interfaces.
Index: builtins.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/builtins.cc,v
retrieving revision 1.1.2.21
diff -u -r1.1.2.21 builtins.cc
--- builtins.cc 9 Mar 2005 02:19:09 -0000 1.1.2.21
+++ builtins.cc 24 Mar 2005 02:07:20 -0000
@@ -554,10 +554,20 @@
tree klass_record = TREE_TYPE (klass_tree);
+ // Lay out superclasses and interfaces.
tree super_record = NULL_TREE;
if (klass->get_superclass () != NULL)
super_record = TREE_TYPE (lay_out_class (klass->get_superclass ()));
+ std::list<ref_forwarding_type> &ifaces (klass->get_interfaces ());
+ for (std::list<ref_forwarding_type>::const_iterator i = ifaces.begin ();
+ i != ifaces.end ();
+ ++i)
+ {
+ model_class *ik = assert_cast<model_class *> ((*i)->type ());
+ lay_out_class (ik);
+ }
+
// Ensure all non-static methods have been added.
std::list<ref_method> methods = klass->get_methods ();
for (std::list<ref_method>::const_iterator i = methods.begin ();