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: avoid double resolution


I'm checking this in on the gcjx branch.

It turns out that we would sometimes double-resolve a
model_forwarding_full (that class really ought to be renamed).
That caused problems since the second resolution, in one case,
occurred in the context of a different compilation unit.
There's no point to doing the work twice.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* model/class.cc (get_accessor): Removed get_location() call.
	* model/fwdtype.cc (resolve): Do nothing if already resolved.

Index: model/class.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/class.cc,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 class.cc
--- model/class.cc 12 Mar 2005 20:51:07 -0000 1.1.2.8
+++ model/class.cc 27 Mar 2005 03:01:49 -0000
@@ -2230,7 +2230,7 @@
 	mods |= ACC_STATIC;
       accm->set_modifiers (mods);
       accm->set_synthetic ();
-      accm->set_return_type (new model_forwarding_resolved (get_location (),
+      accm->set_return_type (new model_forwarding_resolved (where,
 							    meth->get_return_type ()));
 
       // Compute the new formal arguments and actual arguments to the
Index: model/fwdtype.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/fwdtype.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 fwdtype.cc
--- model/fwdtype.cc 13 Jan 2005 03:18:36 -0000 1.1.2.1
+++ model/fwdtype.cc 27 Mar 2005 03:01:49 -0000
@@ -1,6 +1,6 @@
 // Forwarding type implementation.
 
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 //
 // This file is part of GCC.
 //
@@ -83,10 +83,13 @@
 void
 model_forwarding_full::resolve (resolution_scope *scope)
 {
-  resolved_type = classify_type_descriptor (scope, this, name);
   if (resolved_type == NULL)
-    throw error ("couldn't find type named %1")
-      % name;
+    {
+      resolved_type = classify_type_descriptor (scope, this, name);
+      if (resolved_type == NULL)
+	throw error ("couldn't find type named %1")
+	  % name;
+    }
 }
 
 


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