Hi,
For name-lookup cleanup I introduced some accessors that are pure functions when we're not checking. I noticed we already had a couple of them, so introduced an ATTRIBUTE_NTC_PURE define. It avoid #ifndefs and stray semicolons.

ok?

nathan
--
Nathan Sidwell
2017-05-09  Nathan Sidwell  <nat...@acm.org>

	* system.h (ATTRIBUTE_NTC_PURE): New define.
	* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Use it.

Index: system.h
===================================================================
--- system.h	(revision 247784)
+++ system.h	(working copy)
@@ -744,6 +744,13 @@ extern void fancy_abort (const char *, i
 #define gcc_checking_assert(EXPR) ((void)(0 && (EXPR)))
 #endif
 
+/* Some functions are pure when not tree checking.  */
+#ifdef ENABLE_TREE_CHECKING
+#define ATTRIBUTE_NTC_PURE
+#else
+#define ATTRIBUTE_NTC_PURE ATTRIBUTE_PURE
+#endif
+
 /* Use gcc_unreachable() to mark unreachable locations (like an
    unreachable default case of a switch.  Do not use gcc_assert(0).  */
 #if (GCC_VERSION >= 4005) && !ENABLE_ASSERT_CHECKING
Index: tree.h
===================================================================
--- tree.h	(revision 247784)
+++ tree.h	(working copy)
@@ -4109,15 +4109,9 @@ extern int attribute_list_contained (con
 extern int tree_int_cst_equal (const_tree, const_tree);
 
 extern bool tree_fits_shwi_p (const_tree)
-#ifndef ENABLE_TREE_CHECKING
-  ATTRIBUTE_PURE /* tree_fits_shwi_p is pure only when checking is disabled.  */
-#endif
-  ;
+  ATTRIBUTE_NTC_PURE;
 extern bool tree_fits_uhwi_p (const_tree)
-#ifndef ENABLE_TREE_CHECKING
-  ATTRIBUTE_PURE /* tree_fits_uhwi_p is pure only when checking is disabled.  */
-#endif
-  ;
+  ATTRIBUTE_NTC_PURE;
 extern HOST_WIDE_INT tree_to_shwi (const_tree);
 extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree);
 #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003)

Reply via email to