-/* Search for uses of non-const attributes and write code to cache them. */
-
-static int
-write_expr_attr_cache (rtx p, struct attr_desc *attr)
-{
- const char *fmt;
- int i, ie, j, je;
-
- if (GET_CODE (p) == EQ_ATTR)
- {
- if (XSTR (p, 0) != attr->name)
- return 0;
-
- if (!attr->is_numeric)
- printf (" enum attr_%s ", attr->name);
- else
- printf (" int ");
-
- printf ("attr_%s = get_attr_%s (insn);\n", attr->name, attr->name);
- return 1;
- }
-
- fmt = GET_RTX_FORMAT (GET_CODE (p));
- ie = GET_RTX_LENGTH (GET_CODE (p));
- for (i = 0; i < ie; i++)
- {
- switch (*fmt++)
- {
- case 'e':
- if (write_expr_attr_cache (XEXP (p, i), attr))
- return 1;
- break;
-
- case 'E':
- je = XVECLEN (p, i);
- for (j = 0; j < je; ++j)
- if (write_expr_attr_cache (XVECEXP (p, i, j), attr))
- return 1;
- break;
- }
- }
-
- return 0;
-}
-