diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-04 17:32:31 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-04 17:32:31 +0200 |
commit | bfecd57cd46ac368213f55fc4a3ff67c8c59c5ea (patch) | |
tree | 67b42e486b9999f08c29028115ba5ebbee98254b /gcc/cp/class.c | |
parent | fe8b1e839ca91a61440288049a868944346eef4b (diff) | |
download | gcc-bfecd57cd46ac368213f55fc4a3ff67c8c59c5ea.zip gcc-bfecd57cd46ac368213f55fc4a3ff67c8c59c5ea.tar.gz gcc-bfecd57cd46ac368213f55fc4a3ff67c8c59c5ea.tar.bz2 |
extend.texi (Java Exceptions): Remove.
* doc/extend.texi (Java Exceptions): Remove.
(java_interface): Remove.
cp/
* cp-tree.h (enum cp_tree_index): Remove CPTI_JAVA_*,
CPTI_LANG_NAME_JAVA and CPTI_JCLASS.
(java_byte_type_node, java_short_type_node, java_int_type_node,
java_long_type_node, java_float_type_node, java_double_type_node,
java_char_type_node, java_boolean_type_node, lang_name_java,
jclass_node): Remove.
(enum languages): Remove lang_java.
(TYPE_FOR_JAVA): Remove.
(struct lang_type_class): Remove java_interface bit-field.
(TYPE_JAVA_INTERFACE): Remove.
(pragma_java_exceptions): Remove.
(check_java_method, build_java_class_ref): Remove prototypes.
* name-lookup.c (pushtag_1): Don't set TYPE_FOR_JAVA.
* decl2.c (acceptable_java_type, check_java_method): Remove.
(import_export_decl): Remove TYPE_FOR_JAVA handling.
(build_java_method_aliases): Remove.
(c_parse_final_cleanups): Don't call build_java_method_aliases.
(possibly_inlined_p): Don't test pragma_java_exceptions.
* init.c (build_new_1): Remove TYPE_FOR_JAVA handling.
(build_java_class_ref): Remove.
* pt.c (maybe_new_partial_specialization, lookup_template_class_1,
instantiate_class_template_1): Don't copy TYPE_FOR_JAVA.
* except.c (eh_type_info): Remove java type handling.
(decl_is_java_type, choose_personality_routine): Remove.
(initialize_handler_parm): Don't call choose_personality_routine.
(expand_start_catch_block): Don't handle java types.
(build_throw): Likewise.
* cp-lang.c (cp_eh_personality): Don't handle pragma_java_exceptions.
* typeck.c (structural_comptypes): Don't compare TYPE_FOR_JAVA.
* call.c (build_over_call): Don't handle TYPE_JAVA_INTERFACE.
(java_iface_lookup_fn): Remove.
(build_java_interface_fn_ref): Remove.
* tree.c (cxx_attribute_table): Remove java_interface.
(handle_java_interface_attribute): Remove.
* lex.c (pragma_java_exceptions): Remove.
(init_cp_pragma): Don't register GCC java_exceptions pragma.
(handle_pragma_java_exceptions): Remove.
(retrofit_lang_decl): Don't handle lang_name_java.
* method.c (implicitly_declare_fn): Don't handle TYPE_FOR_JAVA.
* error.c (language_to_string): Don't handle lang_java.
* decl.c (record_builtin_java_type): Remove.
(initialize_predefined_identifiers): Remove Java.
(cxx_init_decl_processing): Remove java_*_type_node.
(cp_finish_decl): Don't handle TYPE_FOR_JAVA.
(grokfndecl): Likewise.
(check_special_function_return_type): Likewise.
(grokdeclarator): Don't set TYPE_FOR_JAVA.
(grokparms): Don't handle TYPE_FOR_JAVA.
(xref_basetypes): Likewise.
(check_function_type): Likewise.
(finish_constructor_body): Likewise.
* mangle.c (write_builtin_type): Don't handle TYPE_FOR_JAVA
and java_*_type_node.
(write_bare_function_type): Don't handle TYPE_FOR_JAVA.
(write_java_integer_type_codes): Remove.
* class.c (add_method): Don't handle TYPE_FOR_JAVA.
(add_implicitly_declared_members, determine_key_method,
finish_struct_1): Likewise.
(push_lang_context): Don't handle lang_name_java.
testsuite/
* g++.dg/other/java3.C: Remove.
* g++.dg/other/java1.C: Remove.
* g++.dg/other/error12.C: Remove.
* g++.dg/other/java2.C: Remove.
* g++.dg/warn/Wnvdtor.C: Remove.
* g++.dg/lookup/java1.C: Remove.
* g++.dg/lookup/java2.C: Remove.
* g++.dg/ext/pr34829.C: Remove.
* g++.dg/ext/java-3.C: Remove.
* g++.dg/ext/java-1.C: Remove.
* g++.dg/ext/java-2.C: Remove.
* g++.old-deja/g++.oliva/dwarf2.C: Remove.
From-SVN: r240750
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 62 |
1 files changed, 9 insertions, 53 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index dab1630..34d10ba 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1047,19 +1047,7 @@ add_method (tree type, tree method, tree using_decl) if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (method)) slot = CLASSTYPE_CONSTRUCTOR_SLOT; else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method)) - { - slot = CLASSTYPE_DESTRUCTOR_SLOT; - - if (TYPE_FOR_JAVA (type)) - { - if (!DECL_ARTIFICIAL (method)) - error ("Java class %qT cannot have a destructor", type); - else if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) - error ("Java class %qT cannot have an implicit non-trivial " - "destructor", - type); - } - } + slot = CLASSTYPE_DESTRUCTOR_SLOT; else { tree m; @@ -3349,17 +3337,8 @@ add_implicitly_declared_members (tree t, tree* access_decls, /* Destructor. */ if (!CLASSTYPE_DESTRUCTORS (t)) - { - /* In general, we create destructors lazily. */ - CLASSTYPE_LAZY_DESTRUCTOR (t) = 1; - - if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) - && TYPE_FOR_JAVA (t)) - /* But if this is a Java class, any non-trivial destructor is - invalid, even if compiler-generated. Therefore, if the - destructor is non-trivial we create it now. */ - lazily_declare_fn (sfk_destructor, t); - } + /* In general, we create destructors lazily. */ + CLASSTYPE_LAZY_DESTRUCTOR (t) = 1; /* [class.ctor] @@ -3382,7 +3361,7 @@ add_implicitly_declared_members (tree t, tree* access_decls, If a class definition does not explicitly declare a copy constructor, one is declared implicitly. */ - if (! TYPE_HAS_COPY_CTOR (t) && ! TYPE_FOR_JAVA (t)) + if (! TYPE_HAS_COPY_CTOR (t)) { TYPE_HAS_COPY_CTOR (t) = 1; TYPE_HAS_CONST_COPY_CTOR (t) = !cant_have_const_cctor; @@ -3395,7 +3374,7 @@ add_implicitly_declared_members (tree t, tree* access_decls, when it is needed. For now, just record whether or not the type of the parameter to the assignment operator will be a const or non-const reference. */ - if (!TYPE_HAS_COPY_ASSIGN (t) && !TYPE_FOR_JAVA (t)) + if (!TYPE_HAS_COPY_ASSIGN (t)) { TYPE_HAS_COPY_ASSIGN (t) = 1; TYPE_HAS_CONST_COPY_ASSIGN (t) = !cant_have_const_assignment; @@ -6653,8 +6632,7 @@ determine_key_method (tree type) { tree method; - if (TYPE_FOR_JAVA (type) - || processing_template_decl + if (processing_template_decl || CLASSTYPE_TEMPLATE_INSTANTIATION (type) || CLASSTYPE_INTERFACE_KNOWN (type)) return; @@ -7095,9 +7073,7 @@ finish_struct_1 (tree t) /* Build the VTT for T. */ build_vtt (t); - /* This warning does not make sense for Java classes, since they - cannot have destructors. */ - if (!TYPE_FOR_JAVA (t) && warn_nonvdtor + if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && accessible_nvdtor_p (t) && !CLASSTYPE_FINAL (t)) warning (OPT_Wnon_virtual_dtor, @@ -7832,29 +7808,9 @@ push_lang_context (tree name) vec_safe_push (current_lang_base, current_lang_name); if (name == lang_name_cplusplus) - { - current_lang_name = name; - } - else if (name == lang_name_java) - { - current_lang_name = name; - /* DECL_IGNORED_P is initially set for these types, to avoid clutter. - (See record_builtin_java_type in decl.c.) However, that causes - incorrect debug entries if these types are actually used. - So we re-enable debug output after extern "Java". */ - DECL_IGNORED_P (TYPE_NAME (java_byte_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_short_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_int_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_long_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_float_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_double_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_char_type_node)) = 0; - DECL_IGNORED_P (TYPE_NAME (java_boolean_type_node)) = 0; - } + current_lang_name = name; else if (name == lang_name_c) - { - current_lang_name = name; - } + current_lang_name = name; else error ("language string %<\"%E\"%> not recognized", name); } |