+2014-11-08 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/arm/arm.c: Include rtl-iter.h.
+ (arm_tls_referenced_p_1): Delete.
+ (arm_tls_referenced_p): Use FOR_EACH_SUBRTX.
+
2014-11-08 Richard Sandiford <richard.sandiford@arm.com>
* config/arm/aarch-common.c: Include rtl-iter.h.
#include "gimple-expr.h"
#include "builtins.h"
#include "tm-constrs.h"
+#include "rtl-iter.h"
/* Forward definitions of types. */
typedef struct minipool_node Mnode;
return NULL;
}
-/* Test for various thread-local symbols. */
-
-/* Helper for arm_tls_referenced_p. */
-
-static int
-arm_tls_operand_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
-{
- if (GET_CODE (*x) == SYMBOL_REF)
- return SYMBOL_REF_TLS_MODEL (*x) != 0;
-
- /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
- TLS offsets, not real symbol references. */
- if (GET_CODE (*x) == UNSPEC
- && XINT (*x, 1) == UNSPEC_TLS)
- return -1;
-
- return 0;
-}
-
/* Return TRUE if X contains any TLS symbol references. */
bool
if (! TARGET_HAVE_TLS)
return false;
- return for_each_rtx (&x, arm_tls_operand_p_1, NULL);
+ subrtx_iterator::array_type array;
+ FOR_EACH_SUBRTX (iter, array, x, ALL)
+ {
+ const_rtx x = *iter;
+ if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+ return true;
+
+ /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
+ TLS offsets, not real symbol references. */
+ if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS)
+ iter.skip_subrtxes ();
+ }
+ return false;
}
/* Implement TARGET_LEGITIMATE_CONSTANT_P.