This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Java: more method DECL_NAME wfl fixes, problem with cast.
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Java: more method DECL_NAME wfl fixes, problem with cast.
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Thu, 1 Feb 2001 02:31:21 -0800
- Reply-to: apbianco at cygnus dot com
I found some more problems related to the elimination of WFLs in
method DECL_NAMEs. There's also this cast problem that I found while
building kawa from source the other day. I'm checking this in.
./A
2001-01-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root last
argument.
* parse.y (finish_method_declaration): Code accounting for WFLed
method DECL_NAMEs deleted.
(check_abstract_method_definitions): Likewise.
(resolve_type_during_patch): Layout resolved type.
* typeck.c (lookup_do): Removed unused local.
Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf-parse.c,v
retrieving revision 1.73
diff -u -p -r1.73 jcf-parse.c
--- jcf-parse.c 2001/01/24 08:08:36 1.73
+++ jcf-parse.c 2001/02/01 08:19:03
@@ -1135,5 +1135,5 @@ init_jcf_parse ()
/* Register roots with the garbage collector. */
ggc_add_tree_root (parse_roots, sizeof (parse_roots) / sizeof(tree));
- ggc_add_root (¤t_jcf, 1, sizeof (JCF), ggc_mark_jcf);
+ ggc_add_root (¤t_jcf, 1, sizeof (JCF), (void (*)(void *))ggc_mark_jcf);
}
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.248
diff -u -p -r1.248 parse.y
--- parse.y 2001/01/28 01:50:21 1.248
+++ parse.y 2001/02/01 08:19:41
@@ -4572,21 +4572,21 @@ finish_method_declaration (method_body)
/* 8.4.5 Method Body */
if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body)
{
- tree wfl = DECL_NAME (current_function_decl);
- parse_error_context (wfl,
+ tree name = DECL_NAME (current_function_decl);
+ parse_error_context (DECL_FUNCTION_WFL (current_function_decl),
"%s method `%s' can't have a body defined",
(METHOD_NATIVE (current_function_decl) ?
"Native" : "Abstract"),
- IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl)));
+ IDENTIFIER_POINTER (name));
method_body = NULL_TREE;
}
else if (!(flags & ACC_ABSTRACT) && !(flags & ACC_NATIVE) && !method_body)
{
- tree wfl = DECL_NAME (current_function_decl);
+ tree name = DECL_NAME (current_function_decl);
parse_error_context
- (wfl,
+ (DECL_FUNCTION_WFL (current_function_decl),
"Non native and non abstract method `%s' must have a body defined",
- IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl)));
+ IDENTIFIER_POINTER (name));
method_body = NULL_TREE;
}
@@ -5904,14 +5904,7 @@ check_abstract_method_definitions (do_in
char *t = xstrdup (lang_printable_name
(TREE_TYPE (TREE_TYPE (method)), 0));
tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method)));
- tree saved_wfl = NULL_TREE;
- if (TREE_CODE (DECL_NAME (method)) == EXPR_WITH_FILE_LOCATION)
- {
- saved_wfl = DECL_NAME (method);
- DECL_NAME (method) = EXPR_WFL_NODE (DECL_NAME (method));
- }
-
parse_error_context
(lookup_cl (class_decl),
"Class `%s' doesn't define the abstract method `%s %s' from %s `%s'. This method must be defined or %s `%s' must be declared abstract",
@@ -5924,9 +5917,6 @@ check_abstract_method_definitions (do_in
IDENTIFIER_POINTER (DECL_NAME (class_decl)));
ok = 0;
free (t);
-
- if (saved_wfl)
- DECL_NAME (method) = saved_wfl;
}
}
@@ -13870,7 +13860,7 @@ resolve_type_during_patch (type)
{
if (unresolved_type_p (type, NULL))
{
- tree type_decl = resolve_no_layout (EXPR_WFL_NODE (type), type);
+ tree type_decl = resolve_and_layout (EXPR_WFL_NODE (type), type);
if (!type_decl)
{
parse_error_context (type,
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/typeck.c,v
retrieving revision 1.34
diff -u -p -r1.34 typeck.c
--- typeck.c 2001/01/25 22:25:22 1.34
+++ typeck.c 2001/02/01 08:19:43
@@ -834,8 +834,6 @@ lookup_do (searched_class, searched_inte
method != NULL_TREE; method = TREE_CHAIN (method))
{
tree method_sig = (*signature_builder) (TREE_TYPE (method));
- tree name = DECL_NAME (method);
-
if (DECL_NAME (method) == method_name && method_sig == signature)
return method;
}