2021-04-08 Iain Buclaw * d-attribs.cc: Include fold-const.h and opts.h. (attr_noreturn_exclusions): Add alloc_size. (attr_const_pure_exclusions): Likewise. (attr_inline_exclusions): Add target_clones. (attr_noinline_exclusions): Rename forceinline to always_inline. (attr_target_exclusions): New array. (attr_target_clones_exclusions): New array. (attr_alloc_exclusions): New array. (attr_cold_hot_exclusions): New array. (d_langhook_common_attribute_table): Add new D attribute handlers. (build_attributes): Update to look for gcc.attributes. Issue warning if not given a struct literal. Handle void initialized arguments. (handle_always_inline_attribute): Remove function. (d_handle_noinline_attribute): Don't extract TYPE_LANG_FRONTEND. (d_handle_forceinline_attribute): Rename to... (d_handle_always_inline_attribute): ...this. Remove special handling. (d_handle_flatten_attribute): Don't extract TYPE_LANG_FRONTEND. (d_handle_target_attribute): Likewise. Warn about empty arguments. (d_handle_target_clones_attribute): New function. (optimize_args): New static variable. (parse_optimize_options): New function. (d_handle_optimize_attribute): New function. (d_handle_noclone_attribute): Don't extract TYPE_LANG_FRONTEND. (d_handle_alias_attribute): Remove function. (d_handle_noicf_attribute): New function. (d_handle_noipa_attribute): New function. (d_handle_section_attribute): Call the handle_generic_attribute target hook after performing target independent processing. (d_handle_symver_attribute): New function. (d_handle_noplt_attribute): New function. (positional_argument): New function. (d_handle_alloc_size_attribute): New function. (d_handle_cold_attribute): New function. (d_handle_restrict_attribute): New function. (d_handle_used_attribute): New function. * decl.cc (gcc_attribute_p): Update to look for gcc.attributes. (get_symbol_decl): Update decl source location of old prototypes to the new declaration being merged. * types.cc (layout_aggregate_members): Apply user defined attributes on fields. 2021-04-06 Iain Buclaw PR d/99917 * dmd/MERGE: Merge upstream dmd d16195406. 2021-04-06 Iain Buclaw * d-codegen.cc (build_frame_type): Use Array::find to get index of element. 2021-04-06 Iain Buclaw * d-diagnostic.cc (vwarning): Increment gaggedWarnings if warning message was suppressed. (vdeprecation): Likewise for deprecation messages. 2021-04-06 Iain Buclaw * dmd/MERGE: Merge upstream dmd 5cc71ff83. 2021-04-05 Iain Buclaw PR d/99914 * d-lang.cc (d_init): Disable flag_weak_templates if no support for weak or one-only symbols. * d-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. (DECL_INSTANTIATED): New macro. (d_comdat_linkage): Remove declaration. (d_linkonce_linkage): Remove declaration. (set_linkage_for_decl): New declaration. * decl.cc (DeclVisitor::visit (StructDeclaration *)): Replace call to d_linkonce_linkage with setting DECL_INSTANTIATED. (DeclVisitor::visit (ClassDeclaration *)): Likewise. (DeclVisitor::visit (EnumDeclaration *)): Likewise. (DeclVisitor::visit (InterfaceDeclaration *)): Remove call to d_linkonce_linkage. (get_symbol_decl): Call set_linkage_for_decl instead of d_linkonce_linkage. (d_finish_decl): Call set_linkage_for_decl. (d_comdat_linkage): Made function static. Only set DECL_COMDAT for DECL_INSTANTIATED decls. (d_linkonce_linkage): Remove function. (d_weak_linkage): New function. (set_linkage_for_decl): New function. * gdc.texi (Runtime Options): Rename -fno-weak to -fno-weak-templates, update documentation of option. * lang.opt (fweak): Rename option to ... (fweak-templates): ... this. Update help string. * modules.cc (get_internal_fn): Add Prot parameter. Set generated function flag. (build_internal_fn): Update call to get_internal_fn. (build_dso_cdtor_fn): Likewise. (register_moduleinfo): Call d_finish_decl on dso_slot_node and dso_initialized_node. * typeinfo.cc (TypeInfoVisitor::internal_reference): Call set_linkage_for_decl instead of d_comdat_linkage. (TypeInfoDeclVisitor::visit (TypeInfoDeclaration *)): Remove calls to d_linkonce_linkage and d_comdat_linkage. (get_cpp_typeinfo_decl): Likewise. 2021-04-03 Iain Buclaw * dmd/MERGE: Merge upstream dmd 3b808e838. * Make-lang.in (D_FRONTEND_OBJS): Add d/chkformat.o. * d-codegen.cc (build_struct_literal): Handle special enums. * d-convert.cc (convert_expr): Handle noreturn type. (convert_for_condition): Likewise. * d-target.cc (Target::_init): Set type for wchar_t. (TargetCPP::derivedClassOffset): New method. (Target::libraryObjectMonitors): New method. * decl.cc (get_symbol_decl): Set TREE_THIS_VOLATILE for functions of type noreturn. * toir.cc (IRVisitor::visit (ReturnStatement *)): Handle returning noreturn types. * types.cc (TypeVisitor::visit (TypeNoreturn *)): New method. (TypeVisitor::visit (TypeEnum *)): Handle special enums. 2021-03-28 Iain Buclaw * d-builtins.cc (d_init_versions): Predefine D_PIE if flag_pie is set. 2021-03-28 Iain Buclaw * d-lang.cc (d_enum_underlying_base_type): New function. (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Set as d_enum_underlying_base_type. 2021-03-28 Iain Buclaw * Make-lang.in (DMDGEN_COMPILE): Remove. (d/%.dmdgen.o): Use COMPILER_FOR_BUILD and BUILD_COMPILERFLAGS to build all D generator programs. (D_SYSTEM_H): New macro. (d/idgen.dmdgen.o): Add dependencies to build. (d/impcnvgen.dmdgen.o): Likewise. * d-system.h: Include bconfig.h if GENERATOR_FILE is defined. 2021-03-28 Iain Buclaw * config-lang.in (gtfiles): Remove modules.cc. * modules.cc (struct module_info): Remove GTY marker. (static_ctor_list): Remove variable. (static_dtor_list): Remove variable. (register_moduleinfo): Directly set DECL_STATIC_CONSTRUCTOR on dso_ctor, and DECL_STATIC_DESTRUCTOR on dso_dtor. (d_finish_compilation): Remove static ctor/dtor handling. 2021-03-06 Iain Buclaw * d-lang.cc (d_init_options_struct): Don't set default flag_complex_method. 2021-03-03 Iain Buclaw PR d/99337 * dmd/MERGE: Merge upstream dmd a3c9bf422. 2021-02-13 Iain Buclaw * dmd/MERGE: Merge upstream dmd 7132b3537. * Make-lang.in (D_FRONTEND_OBJS): Add d/dsymbolsem.o, d/semantic2.o, d/semantic3.o, and d/templateparamsem.o. * d-compiler.cc (Compiler::genCmain): Update calls to semantic entrypoint functions. * d-lang.cc (d_parse_file): Likewise. * typeinfo.cc (make_frontend_typeinfo): Likewise. 2021-02-05 Iain Buclaw * d-tree.h (DEF_D_INTRINSIC): Don't insert INTRINSIC_ into the intrinsic code name. * intrinsics.cc (DEF_D_INTRINSIC): Don't insert INTRISIC_ and BUILT_IN_ into the intrinsic and built-in code names. * intrinsics.def: Explicitly use full intrinsic and built-in codes in all definitions. 2021-02-04 Iain Buclaw * dmd/MERGE: Merge upstream dmd 46133f761. * d-builtins.cc (d_build_builtins_module): Set builtins as BUILTINgcc. (maybe_set_builtin_1): Likewise. * d-frontend.cc (eval_builtin): Adjust condition for early return. * intrinsics.cc (maybe_set_intrinsic): Set intrinsics as BUILTINgcc. (maybe_expand_intrinsic): Add case for INTRINSIC_BSWAP16. * intrinsics.def (INTRINSIC_BT): Update signature. (INTRINSIC_BT64): Likewise. (INTRINSIC_BSWAP16): New intrinsic. (INTRINSIC_VLOAD8): Update module. (INTRINSIC_VLOAD16): Likewise. (INTRINSIC_VLOAD32): Likewise. (INTRINSIC_VLOAD64): Likewise. (INTRINSIC_VSTORE8): Likewise. (INTRINSIC_VSTORE16): Likewise. (INTRINSIC_VSTORE32): Likewise. (INTRINSIC_VSTORE64): Likewise. (INTRINSIC_ADDS): Update signature. (INTRINSIC_ADDSL): Likewise. (INTRINSIC_ADDU): Likewise. (INTRINSIC_ADDUL): Likewise. (INTRINSIC_SUBS): Likewise. (INTRINSIC_SUBSL): Likewise. (INTRINSIC_SUBU): Likewise. (INTRINSIC_SUBUL): Likewise. (INTRINSIC_MULS): Likewise. (INTRINSIC_MULSL): Likewise. (INTRINSIC_MULU): Likewise. (INTRINSIC_MULUI): Likewise. (INTRINSIC_MULUL): Likewise. (INTRINSIC_NEGS): Likewise. (INTRINSIC_NEGSL): Likewise. 2021-02-02 Iain Buclaw PR d/98921 * dmd/MERGE: Merge upstream dmd 5e2a81d9c. 2021-01-30 Iain Buclaw * typeinfo.cc (TypeInfoVisitor::visit (TypeInfoDeclaration *)): Don't layout m_arg1 and m_arg2 fields. 2021-01-26 Iain Buclaw * dmd/MERGE: Merge upstream dmd 609c3ce2d. * d-compiler.cc (Compiler::loadModule): Rename to ... (Compiler::onParseModule): ... this. (Compiler::onImport): New function. * d-lang.cc (d_parse_file): Remove call to Compiler::loadModule. 2021-01-21 Iain Buclaw * dmd/MERGE: Merge upstream dmd 3a7ebef73. 2021-01-11 Iain Buclaw * dmd/MERGE: Merge upstream dmd 2d3d13748. * d-lang.cc (d_handle_option): Remove OPT_ftransition_checkimports and OPT_ftransition_import. * gdc.texi (Warnings): Remove documentation for -ftransition=import and -ftransition=checkimports. * lang.opt (ftransition=checkimports): Remove. (ftransition=import): Remove. 2021-01-09 Iain Buclaw * dmd/MERGE: Merge upstream dmd cb1106ad5. 2021-01-09 Iain Buclaw * dmd/MERGE: Merge upstream dmd 9bba772fa. 2021-01-09 Iain Buclaw * dmd/MERGE: Merge upstream dmd e598f69c0. 2021-01-07 Iain Buclaw * dmd/MERGE: Merge upstream dmd 9038e64c5. * d-builtins.cc (build_frontend_type): Update call to Parameter::create. 2021-01-05 Iain Buclaw * dmd/MERGE: Merge upstream dmd a5c86f5b9. * d-builtins.cc (d_eval_constant_expression): Handle ADDR_EXPR trees created by build_string_literal. * d-frontend.cc (retStyle): Remove function. * d-target.cc (d_language_target_info): New variable. (d_target_info_table): Likewise. (Target::_init): Initialize d_target_info_table. (Target::isReturnOnStack): New function. (d_add_target_info_handlers): Likewise. (d_handle_target_cpp_std): Likewise. (d_handle_target_cpp_runtime_library): Likewise. (Target::getTargetInfo): Likewise. * d-target.h (struct d_target_info_spec): New type. (d_add_target_info_handlers): Declare. 2021-01-01 Jakub Jelinek * gdc.texi: Bump @copyrights-d year. 2021-01-01 Jakub Jelinek * ChangeLog-2020: Rotate ChangeLog. New file. Copyright (C) 2021 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.