This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: update tree's find_method and find_field
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 12 Dec 2005 17:31:24 -0700
- Subject: [gcjx] Patch: FYI: update tree's find_method and find_field
- Reply-to: tromey at redhat dot com
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")