h ^= real_hash (CONST_DOUBLE_REAL_VALUE (x));
break;
+ case CONST_VECTOR:
+ {
+ int i;
+ for (i = XVECLEN (x, 0); i-- > 0; )
+ h = h * 251 + const_rtx_hash_1 (&XVECEXP (x, 0, i), data);
+ }
+ break;
+
case SYMBOL_REF:
h ^= htab_hash_string (XSTR (x, 0));
break;
targetm.asm_out.globalize_label (asm_out_file, name);
}
+/* Some targets do not allow a forward or undefined reference in a
+ ASM_OUTPUT_DEF. Thus, a mechanism is needed to defer the output of
+ this assembler code. The following struct holds the declaration
+ and target for a deferred output define. */
+struct output_def_pair GTY(())
+{
+ tree decl;
+ tree target;
+};
+typedef struct output_def_pair *output_def_pair;
+
+/* Define gc'd vector type. */
+DEF_VEC_GC_P(output_def_pair);
+
+/* Vector of output_def_pair pointers. */
+static GTY(()) VEC(output_def_pair) *output_defs;
+
+#ifdef ASM_OUTPUT_DEF
+/* Output the assembler code for a define (equate) using ASM_OUTPUT_DEF
+ or ASM_OUTPUT_DEF_FROM_DECLS. The function defines the symbol whose
+ tree node is DECL to have the value of the tree node TARGET. */
+
+static void
+assemble_output_def (tree decl ATTRIBUTE_UNUSED, tree target ATTRIBUTE_UNUSED)
+{
+#ifdef ASM_OUTPUT_DEF_FROM_DECLS
+ ASM_OUTPUT_DEF_FROM_DECLS (asm_out_file, decl, target);
+#else
+ ASM_OUTPUT_DEF (asm_out_file,
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
+ IDENTIFIER_POINTER (target));
+#endif
+}
+#endif
+
+/* Process the vector of pending assembler defines. */
+
+void
+process_pending_assemble_output_defs (void)
+{
+#ifdef ASM_OUTPUT_DEF
+ unsigned i;
+ output_def_pair p;
+
+ for (i = 0; VEC_iterate (output_def_pair, output_defs, i, p); i++)
+ assemble_output_def (p->decl, p->target);
+
+ output_defs = NULL;
+#endif
+}
+
/* Emit an assembler directive to make the symbol for DECL an alias to
the symbol for TARGET. */
void
assemble_alias (tree decl, tree target)
{
- const char *name;
-
/* We must force creation of DECL_RTL for debug info generation, even though
we don't use it here. */
make_decl_rtl (decl);
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
#ifdef ASM_OUTPUT_DEF
/* Make name accessible from other files, if appropriate. */
maybe_assemble_visibility (decl);
}
-#ifdef ASM_OUTPUT_DEF_FROM_DECLS
- ASM_OUTPUT_DEF_FROM_DECLS (asm_out_file, decl, target);
-#else
- ASM_OUTPUT_DEF (asm_out_file, name, IDENTIFIER_POINTER (target));
-#endif
+ if (TARGET_DEFERRED_OUTPUT_DEFS (decl, target))
+ {
+ output_def_pair p;
+
+ p = ggc_alloc (sizeof (struct output_def_pair));
+ p->decl = decl;
+ p->target = target;
+ VEC_safe_push (output_def_pair, output_defs, p);
+ }
+ else
+ assemble_output_def (decl, target);
#else /* !ASM_OUTPUT_DEF */
#if defined (ASM_OUTPUT_WEAK_ALIAS) || defined (ASM_WEAKEN_DECL)
if (DECL_WEAK (decl))
{
+ const char *name;
tree *p, t;
+
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
#ifdef ASM_WEAKEN_DECL
ASM_WEAKEN_DECL (asm_out_file, decl, name, IDENTIFIER_POINTER (target));
#else