+2014-10-26 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/xtensa/xtensa.c: Include rtl-iter.h.
+ (xtensa_tls_referenced_p_1): Delete.
+ (xtensa_tls_referenced_p): Use FOR_EACH_SUBRTX.
+
2014-10-26 Richard Sandiford <richard.sandiford@arm.com>
* config/sh/sh.c (sh_contains_memref_p_1): Delete.
#include "gimplify.h"
#include "df.h"
#include "builtins.h"
+#include "rtl-iter.h"
/* Enumeration for all of the relational tests, so that we can build
return constantpool_address_p (addr);
}
-/* Helper for xtensa_tls_referenced_p. */
-
-static int
-xtensa_tls_referenced_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
-{
- if (GET_CODE (*x) == SYMBOL_REF)
- return SYMBOL_REF_TLS_MODEL (*x) != 0;
-
- /* Ignore TLS references that have already been legitimized. */
- if (GET_CODE (*x) == UNSPEC)
- {
- switch (XINT (*x, 1))
- {
- case UNSPEC_TPOFF:
- case UNSPEC_DTPOFF:
- case UNSPEC_TLS_FUNC:
- case UNSPEC_TLS_ARG:
- case UNSPEC_TLS_CALL:
- return -1;
- default:
- break;
- }
- }
-
- return 0;
-}
-
-
/* Return TRUE if X contains any TLS symbol references. */
bool
if (! TARGET_HAVE_TLS)
return false;
- return for_each_rtx (&x, xtensa_tls_referenced_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;
+
+ /* Ignore TLS references that have already been legitimized. */
+ if (GET_CODE (x) == UNSPEC)
+ switch (XINT (x, 1))
+ {
+ case UNSPEC_TPOFF:
+ case UNSPEC_DTPOFF:
+ case UNSPEC_TLS_FUNC:
+ case UNSPEC_TLS_ARG:
+ case UNSPEC_TLS_CALL:
+ iter.skip_subrtxes ();
+ break;
+ default:
+ break;
+ }
+ }
+ return false;
}