]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 16 Aug 2022 14:18:02 +0000 (16:18 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 2 Sep 2022 20:20:26 +0000 (22:20 +0200)
This moves all D front-end specific target definitions out of the main
target headers, and into its own header that is included by tm_d.h
instead of pulling in the same headers as tm_p.h.

This fixes the build on target configurations that pull in the default D
language target hooks, and subsequently trigger an error because the
definition of PREFERRED_DEBUGGING_TYPE is behind tm.h, the one header
that is avoided from being included in default-d.cc.

PR d/105659

gcc/ChangeLog:

* config.gcc: Set tm_d_file to ${cpu_type}/${cpu_type}-d.h.
* config/aarch64/aarch64-d.cc: Include tm_d.h.
* config/aarch64/aarch64-protos.h (aarch64_d_target_versions): Move to
config/aarch64/aarch64-d.h.
(aarch64_d_register_target_info): Likewise.
* config/aarch64/aarch64.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/arm/arm-d.cc: Include tm_d.h and arm-protos.h instead of
tm_p.h.
* config/arm/arm-protos.h (arm_d_target_versions): Move to
config/arm/arm-d.h.
(arm_d_register_target_info): Likewise.
* config/arm/arm.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/default-d.cc: Remove memmodel.h include.
* config/freebsd-d.cc: Include tm_d.h instead of tm_p.h.
* config/glibc-d.cc: Likewise.
* config/i386/i386-d.cc: Include tm_d.h.
* config/i386/i386-protos.h (ix86_d_target_versions): Move to
config/i386/i386-d.h.
(ix86_d_register_target_info): Likewise.
(ix86_d_has_stdcall_convention): Likewise.
* config/i386/i386.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
(TARGET_D_HAS_STDCALL_CONVENTION): Likewise.
* config/i386/winnt-d.cc: Include tm_d.h instead of tm_p.h.
* config/mips/mips-d.cc: Include tm_d.h.
* config/mips/mips-protos.h (mips_d_target_versions): Move to
config/mips/mips-d.h.
(mips_d_register_target_info): Likewise.
* config/mips/mips.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/netbsd-d.cc: Include tm_d.h instead of tm.h and memmodel.h.
* config/openbsd-d.cc: Likewise.
* config/pa/pa-d.cc: Include tm_d.h.
* config/pa/pa-protos.h (pa_d_target_versions): Move to
config/pa/pa-d.h.
(pa_d_register_target_info): Likewise.
* config/pa/pa.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/riscv/riscv-d.cc: Include tm_d.h.
* config/riscv/riscv-protos.h (riscv_d_target_versions): Move to
config/riscv/riscv-d.h.
(riscv_d_register_target_info): Likewise.
* config/riscv/riscv.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/rs6000/rs6000-d.cc: Include tm_d.h.
* config/rs6000/rs6000-protos.h (rs6000_d_target_versions): Move to
config/rs6000/rs6000-d.h.
(rs6000_d_register_target_info): Likewise.
* config/rs6000/rs6000.h (TARGET_D_CPU_VERSIONS) Likewise.:
(TARGET_D_REGISTER_CPU_TARGET_INFO) Likewise.:
* config/s390/s390-d.cc: Include tm_d.h.
* config/s390/s390-protos.h (s390_d_target_versions): Move to
config/s390/s390-d.h.
(s390_d_register_target_info): Likewise.
* config/s390/s390.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/sol2-d.cc: Include tm_d.h instead of tm.h and memmodel.h.
* config/sparc/sparc-d.cc: Include tm_d.h.
* config/sparc/sparc-protos.h (sparc_d_target_versions): Move to
config/sparc/sparc-d.h.
(sparc_d_register_target_info): Likewise.
* config/sparc/sparc.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* configure: Regenerate.
* configure.ac (tm_d_file): Remove defaults.h.
(tm_d_include_list): Remove options.h and insn-constants.h.
* config/aarch64/aarch64-d.h: New file.
* config/arm/arm-d.h: New file.
* config/i386/i386-d.h: New file.
* config/mips/mips-d.h: New file.
* config/pa/pa-d.h: New file.
* config/riscv/riscv-d.h: New file.
* config/rs6000/rs6000-d.h: New file.
* config/s390/s390-d.h: New file.
* config/sparc/sparc-d.h: New file.

46 files changed:
gcc/config.gcc
gcc/config/aarch64/aarch64-d.cc
gcc/config/aarch64/aarch64-d.h [new file with mode: 0644]
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.h
gcc/config/arm/arm-d.cc
gcc/config/arm/arm-d.h [new file with mode: 0644]
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.h
gcc/config/default-d.cc
gcc/config/freebsd-d.cc
gcc/config/glibc-d.cc
gcc/config/i386/i386-d.cc
gcc/config/i386/i386-d.h [new file with mode: 0644]
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.h
gcc/config/i386/winnt-d.cc
gcc/config/mips/mips-d.cc
gcc/config/mips/mips-d.h [new file with mode: 0644]
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.h
gcc/config/netbsd-d.cc
gcc/config/openbsd-d.cc
gcc/config/pa/pa-d.cc
gcc/config/pa/pa-d.h [new file with mode: 0644]
gcc/config/pa/pa-protos.h
gcc/config/pa/pa.h
gcc/config/riscv/riscv-d.cc
gcc/config/riscv/riscv-d.h [new file with mode: 0644]
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv.h
gcc/config/rs6000/rs6000-d.cc
gcc/config/rs6000/rs6000-d.h [new file with mode: 0644]
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.h
gcc/config/s390/s390-d.cc
gcc/config/s390/s390-d.h [new file with mode: 0644]
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.h
gcc/config/sol2-d.cc
gcc/config/sparc/sparc-d.cc
gcc/config/sparc/sparc-d.h [new file with mode: 0644]
gcc/config/sparc/sparc-protos.h
gcc/config/sparc/sparc.h
gcc/configure
gcc/configure.ac

index f1391e2614218c4ff6330185214cf388b5f0671c..f4e757bd85320deea932bbe42ffcb42c18e5b1cc 100644 (file)
@@ -558,11 +558,15 @@ xtensa*-*-*)
 esac
 
 tm_file=${cpu_type}/${cpu_type}.h
-tm_d_file=${cpu_type}/${cpu_type}.h
 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
 then
        tm_p_file=${cpu_type}/${cpu_type}-protos.h
-       tm_d_file="${tm_d_file} ${cpu_type}/${cpu_type}-protos.h"
+fi
+
+tm_d_file=
+if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-d.h
+then
+       tm_d_file="${tm_d_file} ${cpu_type}/${cpu_type}-d.h"
 fi
 
 extra_modes=
@@ -668,7 +672,6 @@ case ${target} in
 *-*-darwin*)
   tmake_file="t-darwin "
   tm_file="${tm_file} darwin.h"
-  tm_d_file="${tm_d_file} tm-dwarf2.h"
   darwin_os=`echo ${target} | sed 's/.*darwin\([0-9.]*\).*$/\1/'`
   darwin_maj=`expr "$darwin_os" : '\([0-9]*\).*'`
   macos_min=`expr "$darwin_os" : '[0-9]*\.\([0-9]*\).*'`
@@ -3445,7 +3448,6 @@ xstormy16-*-elf)
        # For historical reasons, the target files omit the 'x'.
        tm_file="elfos.h newlib-stdint.h stormy16/stormy16.h"
        tm_p_file=stormy16/stormy16-protos.h
-       tm_d_file="elfos.h stormy16/stormy16.h"
        md_file=stormy16/stormy16.md
        out_file=stormy16/stormy16.cc
        extra_options=stormy16/stormy16.opt
index d3fcc0b881e39c4b3b0439031ba9c06bd2857379..e0e0401631e5f100396347e5da9cbdc0fd0e7a59 100644 (file)
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/aarch64/aarch64-d.h b/gcc/config/aarch64/aarch64-d.h
new file mode 100644 (file)
index 0000000..c605a68
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the AArch64 architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Defined in aarch64-d.cc  */
+extern void aarch64_d_target_versions (void);
+extern void aarch64_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS aarch64_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO aarch64_d_register_target_info
index 19c9d3cb17995e4ffb047a51831627ba95d20e72..0bb4c9b0e2834689db67a1911a70fa7ae5aefc59 100644 (file)
@@ -1040,10 +1040,6 @@ enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
 void aarch64_get_all_extension_candidates (auto_vec<const char *> *candidates);
 std::string aarch64_get_extension_string_for_isa_flags (uint64_t, uint64_t);
 
-/* Defined in aarch64-d.cc  */
-extern void aarch64_d_target_versions (void);
-extern void aarch64_d_register_target_info (void);
-
 rtl_opt_pass *make_pass_fma_steering (gcc::context *);
 rtl_opt_pass *make_pass_track_speculation (gcc::context *);
 rtl_opt_pass *make_pass_tag_collision_avoidance (gcc::context *);
index 80cfe4b740798072ed2a3d08089ff889943f916a..e6855c640353980d177200f6abae9d4d37fcc084 100644 (file)
 #define TARGET_CPU_CPP_BUILTINS()      \
   aarch64_cpu_cpp_builtins (pfile)
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS aarch64_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO aarch64_d_register_target_info
-
 \f
 
 #define REGISTER_TARGET_PRAGMAS() aarch64_register_pragmas ()
index d65b7524934aa80cf657090fba1ad9fcc82845ee..5c89f1b1079e9a70b179f0edd2bb568f21504f30 100644 (file)
@@ -21,9 +21,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "tm_p.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
+#include "arm-protos.h"
 
 /* Implement TARGET_D_CPU_VERSIONS for ARM targets.  */
 
diff --git a/gcc/config/arm/arm-d.h b/gcc/config/arm/arm-d.h
new file mode 100644 (file)
index 0000000..479a89b
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the ARM architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Defined in arm-d.cc  */
+extern void arm_d_target_versions (void);
+extern void arm_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS arm_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO arm_d_register_target_info
index f8aabbdae378448ec8d4c0019110fb124d244a42..ee226559bfb1b9c4839a05d25c28cfbfd9d11656 100644 (file)
@@ -402,10 +402,6 @@ extern void arm_lang_object_attributes_init (void);
 extern void arm_register_target_pragmas (void);
 extern void arm_cpu_cpp_builtins (struct cpp_reader *);
 
-/* Defined in arm-d.cc  */
-extern void arm_d_target_versions (void);
-extern void arm_d_register_target_info (void);
-
 extern bool arm_is_constant_pool_ref (rtx);
 
 /* The bits in this mask specify which instruction scheduling options should
index f479540812a76e593bd1d55d9ac591cc9f8f8d07..e15722b0be3b39f3f7b4a12be505f47548410075 100644 (file)
@@ -47,10 +47,6 @@ extern char arm_arch_name[];
 /* Target CPU builtins.  */
 #define TARGET_CPU_CPP_BUILTINS() arm_cpu_cpp_builtins (pfile)
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS arm_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO arm_d_register_target_info
-
 #include "config/arm/arm-opts.h"
 
 /* The processor for which instructions should be scheduled.  */
index 2d7abfcba969106f2f81a2c176af73238b0bc82e..30c359ed226e60988bfbcb19d58f9c297de45848 100644 (file)
@@ -18,9 +18,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "memmodel.h"
 #include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
+/* Do not include tm.h or tm_p.h here; definitions needed by the target
+   architecture to initialize targetdm should instead be added to tm_d.h.  */
+
 struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
index 9f0f5e7b6ee278f71f3d2faeb56cb904d98d8c16..189e4a69e78a3356be3986851b891dc459769323 100644 (file)
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "memmodel.h"
 #include "tm.h"
-#include "tm_p.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
index f30af104db8873f2ba959f3d9b49ea37e56ac644..80ef27d19c6c8fd87ffb8930ae7cd42c7c115ed2 100644 (file)
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "memmodel.h"
-#include "tm_p.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
index a62339cae303634dbb9e80ed9c30235ede5ee957..27e2b75fc251ed18577c91d3533afd5153995708 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/i386/i386-d.h b/gcc/config/i386/i386-d.h
new file mode 100644 (file)
index 0000000..b980688
--- /dev/null
@@ -0,0 +1,26 @@
+/* Definitions for the D front end on the x86 architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* In i386-d.cc  */
+extern void ix86_d_target_versions (void);
+extern void ix86_d_register_target_info (void);
+extern bool ix86_d_has_stdcall_convention (unsigned int *, unsigned int *);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS ix86_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO ix86_d_register_target_info
+#define TARGET_D_HAS_STDCALL_CONVENTION ix86_d_has_stdcall_convention
index e27c14ff78316fe8100b0d48ac85b26913f7df85..3b94efefa65ffaba07c17ec90298bb8a6b71b1b5 100644 (file)
@@ -277,11 +277,6 @@ extern bool ix86_extract_perm_from_pool_constant (int*, rtx);
 extern void ix86_target_macros (void);
 extern void ix86_register_pragmas (void);
 
-/* In i386-d.cc  */
-extern void ix86_d_target_versions (void);
-extern void ix86_d_register_target_info (void);
-extern bool ix86_d_has_stdcall_convention (unsigned int *, unsigned int *);
-
 /* In winnt.cc  */
 extern void i386_pe_unique_section (tree, int);
 extern void i386_pe_declare_function_type (FILE *, const char *, int);
index 0de5c77bc7d73730d8e8afb5765e5e89ffea6b69..716bacef5f9f15c6e37a7786cae138ef54fff784 100644 (file)
@@ -608,11 +608,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 /* Target Pragmas.  */
 #define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS ix86_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO ix86_d_register_target_info
-#define TARGET_D_HAS_STDCALL_CONVENTION ix86_d_has_stdcall_convention
-
 #ifndef CC1_SPEC
 #define CC1_SPEC "%(cc1_cpu) "
 #endif
index 3d990a12331a6f9b47b546d7046a896249a7b228..00c28c3964a41a5d8d3a1510f35747c5654f5f67 100644 (file)
@@ -21,9 +21,9 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "target.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
-#include "tm_p.h"
 
 /* Implement TARGET_D_OS_VERSIONS for Windows targets.  */
 
index 41a278a08fd7a78a8b6eaa2dcfa66c8bbe145732..8b6ccd106045edc5374667da3bc9dab4d6c0454a 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/mips/mips-d.h b/gcc/config/mips/mips-d.h
new file mode 100644 (file)
index 0000000..7cb3ed9
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the MIPS architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Routines implemented in mips-d.cc  */
+extern void mips_d_target_versions (void);
+extern void mips_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS mips_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO mips_d_register_target_info
index 9d0f4d90fd9756b631453ef76733c4eedc5de860..86350523c1bc3e4d1f8695ace1b76be42477a806 100644 (file)
@@ -388,8 +388,4 @@ extern void mips_register_frame_header_opt (void);
 extern void mips_expand_vec_cond_expr (machine_mode, machine_mode, rtx *);
 extern void mips_expand_vec_cmp_expr (rtx *);
 
-/* Routines implemented in mips-d.cc  */
-extern void mips_d_target_versions (void);
-extern void mips_d_register_target_info (void);
-
 #endif /* ! GCC_MIPS_PROTOS_H */
index 85ea24c546eccf2e5b9c94ccb65982b2ddfe9a47..74b6e11aabb1814323497a6acd3f1f6591bf0ac9 100644 (file)
@@ -680,10 +680,6 @@ struct mips_cpu_info {
     }                                                                  \
   while (0)
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS mips_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO mips_d_register_target_info
-
 /* Default target_flags if no switches are specified  */
 
 #ifndef TARGET_DEFAULT
index 286f010939fcfab304b78217724a53bec3709a67..cd0c95568a1eb75ab1913e4fae12bb51b613a027 100644 (file)
@@ -20,9 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
-#include "memmodel.h"
-#include "tm_p.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
index c1a2a89807a310ad6897516ebcc05f769511aeba..33c7e41ab62df5d9663ada4ec756ef018db80b22 100644 (file)
@@ -20,9 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "memmodel.h"
-#include "tm.h"
-#include "tm_p.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
index 122ad48044737571e53ad35b5b595e288a109889..077aeb5d634426dfcb02baf2b5dd04eece30d4ea 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "target.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/pa/pa-d.h b/gcc/config/pa/pa-d.h
new file mode 100644 (file)
index 0000000..9a9df10
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the HPPA architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Routines implemented in pa-d.cc  */
+extern void pa_d_target_versions (void);
+extern void pa_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS pa_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO pa_d_register_target_info
index d474d9efc91eba323cdee670b47f7b94d4f0dd7a..fe8b7a5091ec20e70569b6723466f80588fb13f7 100644 (file)
@@ -111,7 +111,3 @@ extern void pa_output_function_label (FILE *);
 extern void hppa_profile_hook (int);
 
 extern const int pa_magic_milli[];
-
-/* Routines implemented in pa-d.cc  */
-extern void pa_d_target_versions (void);
-extern void pa_d_register_target_info (void);
index 95787ab1df2d3bfc7f250c1ccde81d29eb977651..bafdf602138977f3566bd4e1530859bdf8d7b282 100644 (file)
@@ -1300,9 +1300,5 @@ do {                                                                           \
 
 #define NEED_INDICATE_EXEC_STACK 0
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS pa_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO pa_d_register_target_info
-
 /* Output default function prologue for hpux.  */
 #define TARGET_ASM_FUNCTION_PROLOGUE pa_output_function_prologue
index 729de96d398548d6794d082b9800ed298dc58468..a762a35778daf0679c6c22830fcce3face5599e5 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "target.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/riscv/riscv-d.h b/gcc/config/riscv/riscv-d.h
new file mode 100644 (file)
index 0000000..21a989e
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the RISC-V architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Routines implemented in riscv-d.cc  */
+extern void riscv_d_target_versions (void);
+extern void riscv_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS riscv_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO riscv_d_register_target_info
index 2bc0ef06f93ad7d1bfad6f7dc479e77ef557b527..649c5c977e189bcd74e4ac30e6d096a78714e388 100644 (file)
@@ -78,10 +78,6 @@ extern bool riscv_gpr_save_operation_p (rtx);
 /* Routines implemented in riscv-c.cc.  */
 void riscv_cpu_cpp_builtins (cpp_reader *);
 
-/* Routines implemented in riscv-d.cc  */
-extern void riscv_d_target_versions (void);
-extern void riscv_d_register_target_info (void);
-
 /* Routines implemented in riscv-builtins.cc.  */
 extern void riscv_atomic_assign_expand_fenv (tree *, tree *, tree *);
 extern rtx riscv_expand_builtin (tree, rtx, rtx, machine_mode, int);
index e35aaa7cc141a9cc503336dc53593ab16ed35902..eb1284e56d6994d7cab949827c18bfa14d8ecb7e 100644 (file)
@@ -27,10 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 /* Target CPU builtins.  */
 #define TARGET_CPU_CPP_BUILTINS() riscv_cpu_cpp_builtins (pfile)
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS riscv_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO riscv_d_register_target_info
-
 #ifdef TARGET_BIG_ENDIAN_DEFAULT
 #define DEFAULT_ENDIAN_SPEC    "b"
 #else
index 74e78cf9e4d9364fdc773336845d4c5dec9b4e3d..7b9ca5a855e1d1e4475034349d73ff39b09daa47 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/rs6000/rs6000-d.h b/gcc/config/rs6000/rs6000-d.h
new file mode 100644 (file)
index 0000000..c805b30
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the PowerPC architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Declare functions in rs6000-d.cc  */
+extern void rs6000_d_target_versions (void);
+extern void rs6000_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS rs6000_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO rs6000_d_register_target_info
index b3c16e7448d87aa0489da5a6ef8306c66e3f0496..1c0f97edcc2d04c2ed8a45db137fdc8f9fdffa33 100644 (file)
@@ -323,10 +323,6 @@ extern void rs6000_activate_target_options (tree new_tree);
 extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT);
 extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT);
 
-/* Declare functions in rs6000-d.cc  */
-extern void rs6000_d_target_versions (void);
-extern void rs6000_d_register_target_info (void);
-
 #ifdef NO_DOLLAR_IN_LABEL
 const char * rs6000_xcoff_strip_dollar (const char *);
 #endif
index ad9bf0f7358af6067857f33976322c364e582dd7..5f1d5e494da36170c6fbf3f2cc62772cb7335473 100644 (file)
@@ -606,10 +606,6 @@ extern unsigned char rs6000_recip_bits[];
 #define TARGET_CPU_CPP_BUILTINS() \
   rs6000_cpu_cpp_builtins (pfile)
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS rs6000_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO rs6000_d_register_target_info
-
 /* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
    we're compiling for.  Some configurations may need to override it.  */
 #define RS6000_CPU_CPP_ENDIAN_BUILTINS()       \
index 8e631859e674553ba4c50fa9ee9c1b33e5531f6e..0dd4b5c999bb1f7d65e61322988099ba33d7ff20 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/s390/s390-d.h b/gcc/config/s390/s390-d.h
new file mode 100644 (file)
index 0000000..703031b
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the IBM S/390 and zSeries architectures.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* s390-d.cc routines */
+extern void s390_d_target_versions (void);
+extern void s390_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS s390_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO s390_d_register_target_info
index 765d843a4183075644bf602d2db45682bd24ce81..78117c36e030e37c6d0361a714bfac865b27e592 100644 (file)
@@ -175,10 +175,6 @@ extern void s390_register_target_pragmas (void);
 /* Routines for s390-c.cc */
 extern bool s390_const_operand_ok (tree, int, int, tree);
 
-/* s390-d.cc routines */
-extern void s390_d_target_versions (void);
-extern void s390_d_register_target_info (void);
-
 /* Pass management.  */
 namespace gcc { class context; }
 class rtl_opt_pass;
index 2e1bc71e73afd57b42bf3351c8c431c5a314ef27..1114222cd4afb6077bc0b6cc7c2fe867665adad6 100644 (file)
@@ -247,10 +247,6 @@ enum processor_flags
 /* Target CPU builtins.  */
 #define TARGET_CPU_CPP_BUILTINS() s390_cpu_cpp_builtins (pfile)
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS s390_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO s390_d_register_target_info
-
 #ifdef DEFAULT_TARGET_64BIT
 #define TARGET_DEFAULT     (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP    \
                            | MASK_OPT_HTM | MASK_OPT_VX)
index 9caa82e84908c35718e99714666bbb6a632bbecb..0ace79d5aae476cc3e3c617580a6db45a1c79869 100644 (file)
@@ -18,9 +18,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
-#include "memmodel.h"
-#include "tm_p.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
index 1f3a9666b97ef322bb31adf7e39482e78cd02211..f8a3cf30f25fd80ef9e7f3ea4c84e141fbe63883 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "tm_d.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"
 
diff --git a/gcc/config/sparc/sparc-d.h b/gcc/config/sparc/sparc-d.h
new file mode 100644 (file)
index 0000000..b9d8ccf
--- /dev/null
@@ -0,0 +1,24 @@
+/* Definitions for the D front end on the SPARC architecture.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Routines implemented in sparc-d.cc  */
+extern void sparc_d_target_versions (void);
+extern void sparc_d_register_target_info (void);
+
+/* Target hooks for D language.  */
+#define TARGET_D_CPU_VERSIONS sparc_d_target_versions
+#define TARGET_D_REGISTER_CPU_TARGET_INFO sparc_d_register_target_info
index f9e1c74554d3add865435f72ef255b901e667cf6..4ddd00c81e1a90e7cb323c692d4c2f43cacdee4f 100644 (file)
@@ -112,8 +112,4 @@ unsigned int sparc_regmode_natural_size (machine_mode);
 
 extern rtl_opt_pass *make_pass_work_around_errata (gcc::context *);
 
-/* Routines implemented in sparc-d.cc  */
-extern void sparc_d_target_versions (void);
-extern void sparc_d_register_target_info (void);
-
 #endif /* __SPARC_PROTOS_H__ */
index 987340392dd0fd80e7866d86331b171de156e7ee..155e1da7ad7b33d23e7894c194116fe2c8c9acc8 100644 (file)
@@ -27,10 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
 
-/* Target hooks for D language.  */
-#define TARGET_D_CPU_VERSIONS sparc_d_target_versions
-#define TARGET_D_REGISTER_CPU_TARGET_INFO sparc_d_register_target_info
-
 /* Specify this in a cover file to provide bi-architecture (32/64) support.  */
 /* #define SPARC_BI_ARCH */
 
index 2fd6b531862a2d0d9aa671146437b6dec95538f8..39f7ed129a4713846de18e9883f25e7fc4dc7342 100755 (executable)
@@ -13023,7 +13023,6 @@ fi
 
 tm_file="${tm_file} defaults.h"
 tm_p_file="${tm_p_file} tm-preds.h"
-tm_d_file="${tm_d_file} defaults.h"
 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
 # We don't want ansidecl.h in target files, write code there in ISO/GNU C.
@@ -13418,13 +13417,9 @@ for f in $tm_p_file; do
 done
 
 tm_d_file_list=
-tm_d_include_list="options.h insn-constants.h"
+tm_d_include_list=
 for f in $tm_d_file; do
   case $f in
-    defaults.h )
-       tm_d_file_list="${tm_d_file_list} \$(srcdir)/$f"
-       tm_d_include_list="${tm_d_include_list} $f"
-       ;;
     * )
        tm_d_file_list="${tm_d_file_list} \$(srcdir)/config/$f"
        tm_d_include_list="${tm_d_include_list} config/$f"
@@ -19694,7 +19689,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19697 "configure"
+#line 19692 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19800,7 +19795,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19803 "configure"
+#line 19798 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 12b5e934d1ebcb35550c00aff5faf22c430279f4..50bb61c1b6169a3c590b1d7040a06bcc77a5671a 100644 (file)
@@ -2109,7 +2109,6 @@ AC_SUBST(HAVE_AUTO_BUILD)
 
 tm_file="${tm_file} defaults.h"
 tm_p_file="${tm_p_file} tm-preds.h"
-tm_d_file="${tm_d_file} defaults.h"
 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
 # We don't want ansidecl.h in target files, write code there in ISO/GNU C.
@@ -2353,13 +2352,9 @@ for f in $tm_p_file; do
 done
 
 tm_d_file_list=
-tm_d_include_list="options.h insn-constants.h"
+tm_d_include_list=
 for f in $tm_d_file; do
   case $f in
-    defaults.h )
-       tm_d_file_list="${tm_d_file_list} \$(srcdir)/$f"
-       tm_d_include_list="${tm_d_include_list} $f"
-       ;;
     * )
        tm_d_file_list="${tm_d_file_list} \$(srcdir)/config/$f"
        tm_d_include_list="${tm_d_include_list} config/$f"