diff mbox series

[2/3] gimple: Remove custom remove_pointer

Message ID 20240923034750.718980-2-quic_apinski@quicinc.com
State New
Headers show
Series [1/3] Remove commented out PHI_ARG_DEF macro defition | expand

Commit Message

Andrew Pinski Sept. 23, 2024, 3:47 a.m. UTC
Since r11-2700-g22dc89f8073cd0, type_traits has been included via system.h so
we don't need a custom version for gimple.h.

Note a small C++14 cleanup is to use remove_pointer_t directly here instead
of remove_pointer<t>::type.

bootstrapped and tested on x86_64-linux-gnu

gcc/ChangeLog:

	* gimple.h (remove_pointer): Remove.
	(GIMPLE_CHECK2): Use std::remove_pointer instead of custom one.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
 gcc/gimple.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Richard Biener Sept. 23, 2024, 7:12 a.m. UTC | #1
On Mon, Sep 23, 2024 at 5:48 AM Andrew Pinski <quic_apinski@quicinc.com> wrote:
>
> Since r11-2700-g22dc89f8073cd0, type_traits has been included via system.h so
> we don't need a custom version for gimple.h.
>
> Note a small C++14 cleanup is to use remove_pointer_t directly here instead
> of remove_pointer<t>::type.
>
> bootstrapped and tested on x86_64-linux-gnu

OK

> gcc/ChangeLog:
>
>         * gimple.h (remove_pointer): Remove.
>         (GIMPLE_CHECK2): Use std::remove_pointer instead of custom one.
>
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
>  gcc/gimple.h | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/gcc/gimple.h b/gcc/gimple.h
> index ee986eaf153..4a6e0e97d1e 100644
> --- a/gcc/gimple.h
> +++ b/gcc/gimple.h
> @@ -37,10 +37,6 @@ enum gimple_code {
>  extern const char *const gimple_code_name[];
>  extern const unsigned char gimple_rhs_class_table[];
>
> -/* Strip the outermost pointer, from tr1/type_traits.  */
> -template<typename T> struct remove_pointer { typedef T type; };
> -template<typename T> struct remove_pointer<T *> { typedef T type; };
> -
>  /* Error out if a gimple tuple is addressed incorrectly.  */
>  #if defined ENABLE_GIMPLE_CHECKING
>  #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
> @@ -72,7 +68,7 @@ GIMPLE_CHECK2(const gimple *gs,
>    T ret = dyn_cast <T> (gs);
>    if (!ret)
>      gimple_check_failed (gs, file, line, fun,
> -                        remove_pointer<T>::type::code_, ERROR_MARK);
> +                        std::remove_pointer<T>::type::code_, ERROR_MARK);
>    return ret;
>  }
>  template <typename T>
> @@ -91,7 +87,7 @@ GIMPLE_CHECK2(gimple *gs,
>    T ret = dyn_cast <T> (gs);
>    if (!ret)
>      gimple_check_failed (gs, file, line, fun,
> -                        remove_pointer<T>::type::code_, ERROR_MARK);
> +                        std::remove_pointer<T>::type::code_, ERROR_MARK);
>    return ret;
>  }
>  #else  /* not ENABLE_GIMPLE_CHECKING  */
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/gcc/gimple.h b/gcc/gimple.h
index ee986eaf153..4a6e0e97d1e 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -37,10 +37,6 @@  enum gimple_code {
 extern const char *const gimple_code_name[];
 extern const unsigned char gimple_rhs_class_table[];
 
-/* Strip the outermost pointer, from tr1/type_traits.  */
-template<typename T> struct remove_pointer { typedef T type; };
-template<typename T> struct remove_pointer<T *> { typedef T type; };
-
 /* Error out if a gimple tuple is addressed incorrectly.  */
 #if defined ENABLE_GIMPLE_CHECKING
 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
@@ -72,7 +68,7 @@  GIMPLE_CHECK2(const gimple *gs,
   T ret = dyn_cast <T> (gs);
   if (!ret)
     gimple_check_failed (gs, file, line, fun,
-			 remove_pointer<T>::type::code_, ERROR_MARK);
+			 std::remove_pointer<T>::type::code_, ERROR_MARK);
   return ret;
 }
 template <typename T>
@@ -91,7 +87,7 @@  GIMPLE_CHECK2(gimple *gs,
   T ret = dyn_cast <T> (gs);
   if (!ret)
     gimple_check_failed (gs, file, line, fun,
-			 remove_pointer<T>::type::code_, ERROR_MARK);
+			 std::remove_pointer<T>::type::code_, ERROR_MARK);
   return ret;
 }
 #else  /* not ENABLE_GIMPLE_CHECKING  */