diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 2001-01-10 17:05:43 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2001-01-10 09:05:43 -0800 |
commit | 761491c8dc565cd85bfe7b59c41706b61faffd63 (patch) | |
tree | 32b7af9ce6f4e5053e903e857f8b85deacf18cfd /gcc/java/lang.c | |
parent | 31bb3027a6ebbaa77b0d159f792a8fa9147b8841 (diff) | |
download | gcc-761491c8dc565cd85bfe7b59c41706b61faffd63.zip gcc-761491c8dc565cd85bfe7b59c41706b61faffd63.tar.gz gcc-761491c8dc565cd85bfe7b59c41706b61faffd63.tar.bz2 |
[multiple changes]
2001-01-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (lang_printable_name_wls): New prototype.
* lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
rather than `current_class' to print type name. Don't prepend type
names when printing constructor names.
(lang_printable_name_wls): New function.
* jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
`build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
* parse.y (patch_method_invocation): Message tuned for constructors.
(not_accessible_p): Grant `private' access from within
enclosing contexts.
2001-01-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (patch_binop): Compute missing type in error situations.
(http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00752.html)
From-SVN: r38870
Diffstat (limited to 'gcc/java/lang.c')
-rw-r--r-- | gcc/java/lang.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/gcc/java/lang.c b/gcc/java/lang.c index a88203c..e312f50 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -502,18 +502,13 @@ put_decl_node (node) if (TREE_CODE_CLASS (TREE_CODE (node)) == 'd' && DECL_NAME (node) != NULL_TREE) { -#if 0 - if (DECL_CONTEXT (node) != NULL_TREE) - { - put_decl_node (DECL_CONTEXT (node)); - put_decl_string (".", 1); - } -#endif + /* We want to print the type the DECL belongs to. We don't do + that when we handle constructors. */ if (TREE_CODE (node) == FUNCTION_DECL - && DECL_INIT_P (node) - && !DECL_ARTIFICIAL (node) && current_class) - put_decl_node (TYPE_NAME (current_class)); - else + && ! DECL_CONSTRUCTOR_P (node) + && ! DECL_ARTIFICIAL (node) && DECL_CONTEXT (node)) + put_decl_node (TYPE_NAME (DECL_CONTEXT (node))); + else if (! DECL_CONSTRUCTOR_P (node)) put_decl_node (DECL_NAME (node)); if (TREE_CODE (node) == FUNCTION_DECL && TREE_TYPE (node) != NULL_TREE) { @@ -574,6 +569,21 @@ lang_printable_name (decl, v) return decl_buf; } +/* Does the same thing that lang_printable_name, but add a leading + space to the DECL name string -- With Leading Space. */ + +const char * +lang_printable_name_wls (decl, v) + tree decl; + int v __attribute__ ((__unused__)); +{ + decl_bufpos = 1; + put_decl_node (decl); + put_decl_string ("", 1); + decl_buf [0] = ' '; + return decl_buf; +} + /* Print on stderr the current class and method context. This function is the value of the hook print_error_function, called from toplev.c. */ |