This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: restructure find_decl
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 08 Mar 2005 14:39:00 -0700
- Subject: [gcjx] Patch: FYI: restructure find_decl
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
Every time I looked at this function I was checking to make sure it
was really correct. I rewrote it so I wouldn't keep doing that.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* builtins.cc (find_decl): Restructured to use assert instead of
abort.
Index: builtins.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/builtins.cc,v
retrieving revision 1.1.2.18
diff -u -r1.1.2.18 builtins.cc
--- builtins.cc 8 Mar 2005 21:39:25 -0000 1.1.2.18
+++ builtins.cc 8 Mar 2005 21:40:30 -0000
@@ -619,12 +619,17 @@
{
// This may only be called for local fields.
tree tname = get_identifier (name);
+ tree result = NULL_TREE;
for (tree field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
{
if (DECL_NAME (field) == tname)
- return field;
+ {
+ result = field;
+ break;
+ }
}
- abort ();
+ assert (result != NULL_TREE);
+ return result;
}
std::string