]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rust: Reintroduce TARGET_RUST_OS_INFO hook
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 28 Sep 2022 13:33:41 +0000 (15:33 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 21 Sep 2023 09:15:02 +0000 (11:15 +0200)
gcc/ChangeLog:

* doc/tm.texi: Regenerate.
* doc/tm.texi.in: Document TARGET_RUST_OS_INFO.

gcc/rust/ChangeLog:

* rust-session-manager.cc (Session::init): Call
targetrustm.rust_os_info.
* rust-target.def (rust_os_info): New hook.

gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/rust/rust-session-manager.cc
gcc/rust/rust-target.def

index f7a2f8be54261ff914ac1b7db5b07034cbd48715..b0779724d30a6d58d85016522037d12b73da965f 100644 (file)
@@ -10975,6 +10975,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
index cd4e687aea117bf4f160ed6cc6427c0dca214638..d3e189556289de354e6594b33afeac9ffe8bb817 100644 (file)
@@ -7150,6 +7150,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
index 112960ad3c09c683c62b45dddb7e1e09bf720016..ce1fdbb02afcfccf5ca51390da74ff6dc0b76c93 100644 (file)
@@ -140,6 +140,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",
index 285b7503528b4b413883a140211b9dea1d61c1c1..9c72c1c86d3a89714ce26fc01f09610a796fa644 100644 (file)
@@ -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)