From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 1B91F3858412; Mon, 10 Oct 2022 07:33:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B91F3858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665387203; bh=gQDSQgGzHSgRNw/JnjunGkZCu4rTjPQqD4OxmrXWIEY=; h=From:To:Subject:Date:From; b=pwJmWSmk3Abg8rGcYIhmDe7RpW8V3wjZnsuJO0mfRaDJ7FrDp8yl+NfArHvCPe8u4 ZV1MbN4v+BTfuLWpBnS6VnoMRGmUVf69ryHffKtPrNHvn9e40lrz2VGiePVVurj4WC 4Z0P4YQRoaBARUGRrry3Xyh9OgAU7xf8DXZ/fi1Q= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] rust: Reintroduce TARGET_RUST_OS_INFO hook X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: f97e0ca6e4e5efb33a47f8a1f0a49375fd1197f9 X-Git-Newrev: b220923f96344397c584245c09234a700b0ca243 Message-Id: <20221010073323.1B91F3858412@sourceware.org> Date: Mon, 10 Oct 2022 07:33:23 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b220923f96344397c584245c09234a700b0ca243 commit b220923f96344397c584245c09234a700b0ca243 Author: Iain Buclaw Date: Wed Sep 28 15:33:41 2022 +0200 rust: Reintroduce TARGET_RUST_OS_INFO hook gcc/ChangeLog: * doc/tm.texi: Regenerate. * doc/tm.texi.in: Document TARGET_RUST_OS_INFO. gcc/rust/ChangeLog: * rust/rust-session-manager.cc (Session::init): Call targetrustm.rust_os_info. * rust/rust-target.def (rust_os_info): New hook. Diff: --- gcc/doc/tm.texi | 5 +++++ gcc/doc/tm.texi.in | 2 ++ gcc/rust/rust-session-manager.cc | 1 + gcc/rust/rust-target.def | 8 ++++++++ 4 files changed, 16 insertions(+) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 638296d6fb9..75ae4b2aebe 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -10895,6 +10895,11 @@ Configuration pairs predefined by this hook apply to all files that are being compiled. @end deftypefn +@deftypefn {Rust Target Hook} void TARGET_RUST_OS_INFO (void) +Similar to @code{TARGET_RUST_CPU_INFO}, but is used for configuration info +relating to the target operating system. +@end deftypefn + @node Named Address Spaces @section Adding support for named address spaces @cindex named address spaces diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 911d5dca4e6..c8c2b8bd83c 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -7134,6 +7134,8 @@ floating-point support; they are not included in this mechanism. @hook TARGET_RUST_CPU_INFO +@hook TARGET_RUST_OS_INFO + @node Named Address Spaces @section Adding support for named address spaces @cindex named address spaces diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 0947c18152c..ef1a85d9a56 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -138,6 +138,7 @@ Session::init () { // initialize target hooks targetrustm.rust_cpu_info (); + targetrustm.rust_os_info (); // target-independent values that should exist in all targets options.target_data.insert_key_value_pair ("target_pointer_width", diff --git a/gcc/rust/rust-target.def b/gcc/rust/rust-target.def index 285b7503528..9c72c1c86d3 100644 --- a/gcc/rust/rust-target.def +++ b/gcc/rust/rust-target.def @@ -40,5 +40,13 @@ compiled.", void, (void), hook_void_void) +/* Environmental OS info relating to the target OS. */ +DEFHOOK +(rust_os_info, + "Similar to @code{TARGET_RUST_CPU_INFO}, but is used for configuration info\n\ +relating to the target operating system.", + void, (void), + hook_void_void) + /* Close the 'struct gcc_targetrustm' definition. */ HOOK_VECTOR_END (C90_EMPTY_HACK)