Define target hook TARGET_UNWIND_EMIT_BEFORE_INSN.
authorRichard Henderson <rth@gcc.gnu.org>
Tue, 7 Sep 2010 17:25:11 +0000 (10:25 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 7 Sep 2010 17:25:11 +0000 (10:25 -0700)
From-SVN: r163961

gcc/ChangeLog
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/final.c
gcc/target.def

index 746b3fbdd76e6105ebce5cf72e272de0df4bbdc8..f544f7357697723f04eb232df7a385ef885262c2 100644 (file)
@@ -1,3 +1,10 @@
+2010-09-07  Richard Henderson  <rth@redhat.com>
+
+       * target.def (unwind_emit_before_insn): New hook.
+       * doc/tm.texi.in: Add @hook marker for it.
+       * doc/tm.texi: Rebuild.
+       * final.c (final_scan_insn): Respect unwind_emit_before_insn.
+
 2010-09-07  Martin Jambor  <mjambor@suse.cz>
 
        PR fortran/43665
@@ -6,8 +13,8 @@
 
 2010-09-07  Jan Hubicka  <jh@suse.cz>
 
-       * tree-ssa-ccp.c (fold_const_aggregate_ref): Fix handling of array_ref_low_bound
-       in string access folding.
+       * tree-ssa-ccp.c (fold_const_aggregate_ref): Fix handling of
+       array_ref_low_bound in string access folding.
 
 2010-09-07  Uros Bizjak  <ubizjak@gmail.com>
 
index 5954ea38c24e20ed2c416a92704f2e71d923a199..a8db902db7a897bc12f36d4ed419cb42a8a07959 100644 (file)
@@ -8749,6 +8749,10 @@ This target hook emits assembly directives required to unwind the
 given instruction.  This is only used when TARGET_UNWIND_INFO is set.
 @end deftypefn
 
+@deftypevr {Target Hook} bool TARGET_ASM_UNWIND_EMIT_BEFORE_INSN
+True if the @code{TARGET_ASM_UNWIND_EMIT} hook should be called before the assembly for @var{insn} has been emitted, false if the hook should be called afterward.
+@end deftypevr
+
 @node Exception Region Output
 @subsection Assembler Commands for Exception Regions
 
index 24f5c1b3a761e585bfae9896de15c07fc13402eb..2efc1ae4eba1adbae011fd2aae1ebce2245955d1 100644 (file)
@@ -8739,6 +8739,8 @@ This target hook emits assembly directives required to unwind the
 given instruction.  This is only used when TARGET_UNWIND_INFO is set.
 @end deftypefn
 
+@hook TARGET_ASM_UNWIND_EMIT_BEFORE_INSN
+
 @node Exception Region Output
 @subsection Assembler Commands for Exception Regions
 
index 73c60691d276063db47cf4e6d9f8856ed5ac0a63..06ebc17dadee941a11883316cf14d09a0b7378de 100644 (file)
@@ -2655,7 +2655,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
        /* ??? This will put the directives in the wrong place if
           get_insn_template outputs assembly directly.  However calling it
           before get_insn_template breaks if the insns is split.  */
-       if (targetm.asm_out.unwind_emit)
+       if (targetm.asm_out.unwind_emit_before_insn
+           && targetm.asm_out.unwind_emit)
          targetm.asm_out.unwind_emit (asm_out_file, insn);
 
        if (CALL_P (insn))
@@ -2713,6 +2714,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
          dwarf2out_frame_debug (insn, true);
 #endif
 
+       if (!targetm.asm_out.unwind_emit_before_insn
+           && targetm.asm_out.unwind_emit)
+         targetm.asm_out.unwind_emit (asm_out_file, insn);
+
        current_output_insn = debug_insn = 0;
       }
     }
index f11328bc23dbacf614f9d4b21adf4e32baae00fa..e62a977182dff6763f93750186b53fd900e8661e 100644 (file)
@@ -152,6 +152,13 @@ DEFHOOK
  void, (FILE *stream, rtx insn),
  NULL)
 
+DEFHOOKPOD
+(unwind_emit_before_insn,
+ "True if the @code{TARGET_ASM_UNWIND_EMIT} hook should be called before\
+ the assembly for @var{insn} has been emitted, false if the hook should\
+ be called afterward.",
+ bool, true)
+
 /* Output an internal label.  */
 DEFHOOK
 (internal_label,