tree.h: Hide wi::from_mpz from GENERATOR_FILE

Message ID 743141ec-624e-0cab-f30e-54765c3c6b05@linux.ibm.com
State Accepted
Headers
Series tree.h: Hide wi::from_mpz from GENERATOR_FILE |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Kewen.Lin June 30, 2023, 5:20 a.m. UTC
  Hi,

Similar to r0-85707-g34917a102a4e0c for PR35051, the uses
of mpz_t should be guarded with "#ifndef GENERATOR_FILE".
This patch is to fix it and avoid some possible build
errors.

Bootstrapped and regress-tested on x86_64-redhat-linux,
and powerpc64{,le}-linux-gnu.  And cross-build well on
power for 40+ different ports.

Is it ok for trunk?

gcc/ChangeLog:

	* tree.h (wi::from_mpz): Hide from GENERATOR_FILE.
---
 gcc/tree.h | 2 ++
 1 file changed, 2 insertions(+)

--
2.39.3
  

Comments

Richard Biener June 30, 2023, 8:50 a.m. UTC | #1
On Fri, Jun 30, 2023 at 7:20 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> Similar to r0-85707-g34917a102a4e0c for PR35051, the uses
> of mpz_t should be guarded with "#ifndef GENERATOR_FILE".
> This patch is to fix it and avoid some possible build
> errors.
>
> Bootstrapped and regress-tested on x86_64-redhat-linux,
> and powerpc64{,le}-linux-gnu.  And cross-build well on
> power for 40+ different ports.
>
> Is it ok for trunk?

OK.

> gcc/ChangeLog:
>
>         * tree.h (wi::from_mpz): Hide from GENERATOR_FILE.
> ---
>  gcc/tree.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gcc/tree.h b/gcc/tree.h
> index 1854fe4a7d4..7e92a12f9cb 100644
> --- a/gcc/tree.h
> +++ b/gcc/tree.h
> @@ -6460,7 +6460,9 @@ namespace wi
>
>    wide_int min_value (const_tree);
>    wide_int max_value (const_tree);
> +#ifndef GENERATOR_FILE
>    wide_int from_mpz (const_tree, mpz_t, bool);
> +#endif
>  }
>
>  template <typename T>
> --
> 2.39.3
  

Patch

diff --git a/gcc/tree.h b/gcc/tree.h
index 1854fe4a7d4..7e92a12f9cb 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -6460,7 +6460,9 @@  namespace wi

   wide_int min_value (const_tree);
   wide_int max_value (const_tree);
+#ifndef GENERATOR_FILE
   wide_int from_mpz (const_tree, mpz_t, bool);
+#endif
 }

 template <typename T>