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: name mangler fix


I'm checking this in on the gcjx branch.

We needed a small special case in the mangler for methods declared in
an array type.  It seemed simpler to put it here than in the compiler
itself.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* aot/mangle.cc (mangler): Special case array types.

Index: aot/mangle.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/aot/Attic/mangle.cc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 mangle.cc
--- aot/mangle.cc 31 Jan 2005 00:59:16 -0000 1.1.2.2
+++ aot/mangle.cc 31 Jan 2005 01:14:55 -0000
@@ -210,8 +210,15 @@
 mangler::mangler (model_method *m)
   : result ("_Z")
 {
-  // Emit the declaring class.
-  update (m->get_declaring_class (), false);
+  // Emit the declaring class.  Note that we might be called for a
+  // method that is declared for an array type.  In this case we
+  // substitute the Object variant.  This is a bit strange in that
+  // really we will never emit references to these names.  FIXME: fix
+  // in the caller?
+  model_class *decl = m->get_declaring_class ();
+  if (decl->array_p ())
+    decl = global->get_compiler ()->java_lang_Object ();
+  update (decl, false);
 
   // Emit the name, or the special name we use for a constructor.
   if (m->constructor_p ())


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