]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Add TARGET_D_REGISTER_OS_TARGET_INFO
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 5 Apr 2021 18:40:38 +0000 (20:40 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 14 Apr 2021 13:33:32 +0000 (15:33 +0200)
This allows target platforms that have D support files to defined their
own target-specific information keys.

gcc/ChangeLog:

* doc/tm.texi: Regenerate.
* doc/tm.texi.in (D language and ABI): Add @hook for
TARGET_D_REGISTER_OS_TARGET_INFO.

gcc/d/ChangeLog:

* d-target.cc (Target::_init): Call new targetdm hook to register OS
specific target info keys.
* d-target.def (d_register_os_target_info): New hook.

gcc/d/d-target.cc
gcc/d/d-target.def
gcc/doc/tm.texi
gcc/doc/tm.texi.in

index d576b74af1c0df4df3bea8dbed27554b2af57149..be354d9f1f0b12f4a738e189ad47fa9bc40468c6 100644 (file)
@@ -199,6 +199,7 @@ Target::_init (const Param &)
   /* Initialize target info tables, the keys required by the language are added
      last, so that the OS and CPU handlers can override.  */
   targetdm.d_register_cpu_target_info ();
+  targetdm.d_register_os_target_info ();
   d_add_target_info_handlers (d_language_target_info);
 }
 
index cd0397c15774f58f2dba11a1c9accdacbf4128f4..aa6bf55e6e691b45dc510f3ea5383479e8f920fe 100644 (file)
@@ -58,6 +58,14 @@ describing the requested target information.",
  void, (void),
  hook_void_void)
 
+/* getTargetInfo keys relating to the target OS.  */
+DEFHOOK
+(d_register_os_target_info,
+ "Same as @code{TARGET_D_CPU_TARGET_INFO}, but is used for keys relating to\n\
+the target operating system.",
+ void, (void),
+ hook_void_void)
+
 /* ModuleInfo section name and brackets.  */
 DEFHOOKPOD
 (d_minfo_section,
index 6201df9a67d602206146c2434b9bd8d41dd5d8ae..97c8eebcd6f71ce6bae33407a35699d16a612c02 100644 (file)
@@ -10817,6 +10817,11 @@ added by this hook are made available at compile time by the
 describing the requested target information.
 @end deftypefn
 
+@deftypefn {D Target Hook} void TARGET_D_REGISTER_OS_TARGET_INFO (void)
+Same as @code{TARGET_D_CPU_TARGET_INFO}, but is used for keys relating to
+the target operating system.
+@end deftypefn
+
 @deftypevr {D Target Hook} {const char *} TARGET_D_MINFO_SECTION
 Contains the name of the section in which module info references should be
 placed.  This section is expected to be bracketed by two symbols to indicate
index bde57585b03d0b5a54e5b20b2ffdc1eac0919960..e2d49ee9f5788dd0dfce1147a63b615f2788eabd 100644 (file)
@@ -7359,6 +7359,8 @@ floating-point support; they are not included in this mechanism.
 
 @hook TARGET_D_REGISTER_CPU_TARGET_INFO
 
+@hook TARGET_D_REGISTER_OS_TARGET_INFO
+
 @hook TARGET_D_MINFO_SECTION
 
 @hook TARGET_D_MINFO_START_NAME