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: update tree's find_method and find_field


I'm checking this in on the gcjx branch.

This changes the tree back end to follow the bytecode back end for
find_method and find_field.

Tom

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

	* tree.cc (find_method): Take type erasures.
	(find_field): Likewise.

Index: tree.cc
===================================================================
--- tree.cc	(revision 105944)
+++ tree.cc	(working copy)
@@ -1330,7 +1330,7 @@
       if (! argtype || len != 1)
 	continue;
       ref_variable_decl var = params.front ();
-      if (var->type () == argtype)
+      if (var->type ()->erasure () == argtype)
 	{
 	  result = meth;
 	  break;
@@ -1345,7 +1345,7 @@
 	% mname % (argtype ? argtype : primitive_void_type) % klass;
     }
 
-  if (result->get_return_type () != result_type)
+  if (result->get_return_type ()->erasure () != result_type)
     {
       throw request->error ("method %1 doesn't have expected return type"
 			    " of %2")
@@ -2606,7 +2606,7 @@
   if (result.size () == 1)
     {
       model_field *field = *(result.begin ());
-      if (field->type () == type)
+      if (field->type ()->erasure () == type)
 	return field;
     }
   throw request->error ("couldn't find field %1 of type %2 in class %3")


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