diff options
author | Tom Tromey <tromey@redhat.com> | 2003-02-24 02:14:49 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-02-24 02:14:49 +0000 |
commit | f94ae54025ed8721d16c5e514797af4edaf850ba (patch) | |
tree | d282aebf536e61a47d7f1fade565cbb3e83027e2 /gcc/java/jcf-parse.c | |
parent | 804b2c48eab2cb65fb0ae268c8a40e91c24777ff (diff) | |
download | gcc-f94ae54025ed8721d16c5e514797af4edaf850ba.zip gcc-f94ae54025ed8721d16c5e514797af4edaf850ba.tar.gz gcc-f94ae54025ed8721d16c5e514797af4edaf850ba.tar.bz2 |
lang-options.h: Added -Wdeprecated.
* lang-options.h: Added -Wdeprecated.
* gcj.texi (Warnings): Document -Wdeprecated.
* java-tree.h (flag_deprecated): Declare.
* lang.c (lang_W_options): Added deprecated.
(flag_deprecated): New global.
* chartables.h: Rebuilt.
* gen-table.pl (process_one): Look at whitespace.
(print_tables): Define LETTER_SPACE, LETTER_MASK.
* parse.h (CLEAR_DEPRECATED): New macro.
(CHECK_DEPRECATED_NO_RESET): New macro.
* jcf-parse.c (handle_deprecated): New function.
(HANDLE_DEPRECATED_ATTRIBUTE): New define.
* jcf-reader.c (get_attribute): Handle Deprecated attribute.
* parse.y (resolve_type_during_patch): Check deprecation.
(jdep_resolve_class): Likewise.
(process_imports): Likewise.
(resolve_expression_name): Likewise.
(check_deprecation): Strip arrays from decl. Check
flag_deprecated.
(patch_method_invocation): Also check the particular constructor
for deprecation.
(register_fields): Use CHECK_DEPRECATED_NO_RESET in loop.
* jcf-write.c (append_deprecated_attribute): New function.
(generate_classfile): Generate deprecated attribute when
appropriate.
* lex.c (java_parse_doc_section): Return type now void. Rewrote.
(java_lex) [case '*']: Simplify logic.
(java_start_char_p): Use LETTER_MASK.
(java_part_char_p): Likewise.
(java_space_char_p): New function.
From-SVN: r63350
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index ac4757c..8dacecc 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -102,10 +102,28 @@ static void parse_source_file_1 (tree, FILE *); static void parse_source_file_2 (void); static void parse_source_file_3 (void); static void parse_class_file (void); +static void handle_deprecated (void); static void set_source_filename (JCF *, int); static void jcf_parse (struct JCF*); static void load_inner_classes (tree); +/* Handle "Deprecated" attribute. */ +static void +handle_deprecated (void) +{ + if (current_field != NULL_TREE) + FIELD_DEPRECATED (current_field) = 1; + else if (current_method != NULL_TREE) + METHOD_DEPRECATED (current_method) = 1; + else if (current_class != NULL_TREE) + CLASS_DEPRECATED (TYPE_NAME (current_class)) = 1; + else + { + /* Shouldn't happen. */ + abort (); + } +} + /* Handle "SourceFile" attribute. */ static void @@ -200,6 +218,8 @@ set_source_filename (JCF *jcf, int index) DECL_FUNCTION_THROWS (current_method) = nreverse (list); \ } +#define HANDLE_DEPRECATED_ATTRIBUTE() handle_deprecated () + /* Link seen inner classes to their outer context and register the inner class to its outer context. They will be later loaded. */ #define HANDLE_INNERCLASSES_ATTRIBUTE(COUNT) \ |