public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/ibuclaw/heads/mingw)] d: Add TARGET_D_REGISTER_OS_TARGET_INFO
Date: Tue, 13 Apr 2021 20:41:57 +0000 (GMT)	[thread overview]
Message-ID: <20210413204157.760B13951C83@sourceware.org> (raw)

https://gcc.gnu.org/g:f4762bf3ce3e7b222df9c28bdf4909e620e4ef90

commit f4762bf3ce3e7b222df9c28bdf4909e620e4ef90
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Mon Apr 5 20:40:38 2021 +0200

    d: Add TARGET_D_REGISTER_OS_TARGET_INFO
    
    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.

Diff:
---
 gcc/d/d-target.cc  | 1 +
 gcc/d/d-target.def | 8 ++++++++
 gcc/doc/tm.texi    | 5 +++++
 gcc/doc/tm.texi.in | 2 ++
 4 files changed, 16 insertions(+)

diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc
index d576b74af1c..be354d9f1f0 100644
--- a/gcc/d/d-target.cc
+++ b/gcc/d/d-target.cc
@@ -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);
 }
 
diff --git a/gcc/d/d-target.def b/gcc/d/d-target.def
index cd0397c1577..aa6bf55e6e6 100644
--- a/gcc/d/d-target.def
+++ b/gcc/d/d-target.def
@@ -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,
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 6201df9a67d..97c8eebcd6f 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -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
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index bde57585b03..e2d49ee9f57 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -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


             reply	other threads:[~2021-04-13 20:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 20:41 Iain Buclaw [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-11 18:58 Iain Buclaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210413204157.760B13951C83@sourceware.org \
    --to=ibuclaw@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).