]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH 1/3][GCC] Add new target hook asm_post_cfi_startproc
authorSam Tebbs <sam.tebbs@arm.com>
Fri, 14 Dec 2018 15:52:05 +0000 (15:52 +0000)
committerSam Tebbs <samtebbs@gcc.gnu.org>
Fri, 14 Dec 2018 15:52:05 +0000 (15:52 +0000)
2018-12-14  Sam Tebbs  <sam.tebbs@arm.com>

* doc/tm.texi (TARGET_ASM_POST_CFI_STARTPROC): Define.
* doc/tm.texi.in (TARGET_ASM_POST_CFI_STARTPROC): Define.
* dwarf2out.c (dwarf2out_do_cfi_startproc): Trigger the hook.
* hooks.c (hook_void_FILEptr_tree): Define.
* hooks.h (hook_void_FILEptr_tree): Define.
* target.def (post_cfi_startproc): Define.

From-SVN: r267135

gcc/ChangeLog
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/dwarf2out.c
gcc/hooks.c
gcc/hooks.h
gcc/target.def

index afbdf75c62c96f7aeb7ae49a1b1bf4bff6a2e219..6ce06582e0f20c56d27ee25c20daa14eb39e62e1 100644 (file)
@@ -1,3 +1,12 @@
+2018-12-14  Sam Tebbs  <sam.tebbs@arm.com>
+
+       * doc/tm.texi (TARGET_ASM_POST_CFI_STARTPROC): Define.
+       * doc/tm.texi.in (TARGET_ASM_POST_CFI_STARTPROC): Define.
+       * dwarf2out.c (dwarf2out_do_cfi_startproc): Trigger the hook.
+       * hooks.c (hook_void_FILEptr_tree): Define.
+       * hooks.h (hook_void_FILEptr_tree): Define.
+       * target.def (post_cfi_startproc): Define.
+
 2018-12-14  Tom de Vries  <tdevries@suse.de>
 
        * lto-cgraph.c (verify_node_partition): New function.
index e348f0a7da6fad46033d951273b135295a5a89a3..c9a85606f1b2752c3a44845431464e3bcebe9bb1 100644 (file)
@@ -9422,6 +9422,15 @@ If this macro is not defined, nothing special is output at the end of
 the jump-table.
 @end defmac
 
+@deftypefn {Target Hook} void TARGET_ASM_POST_CFI_STARTPROC (FILE *@var{}, @var{tree})
+This target hook is used to emit assembly strings required by the target
+after the .cfi_startproc directive.  The first argument is the file stream to
+write the strings to and the second argument is the function's declaration.  The
+expected use is to add more .cfi_* directives.
+
+The default is to not output any assembly strings.
+@end deftypefn
+
 @deftypefn {Target Hook} void TARGET_ASM_EMIT_UNWIND_LABEL (FILE *@var{stream}, tree @var{decl}, int @var{for_eh}, int @var{empty})
 This target hook emits a label at the beginning of each FDE@.  It
 should be defined on targets where FDEs need special labels, and it
index f1ad80da467c095b9372d05eaf1bf83c5a4aeaa6..2205e2df46b8ab27982f2d25613ce3614a18857f 100644 (file)
@@ -6429,6 +6429,8 @@ If this macro is not defined, nothing special is output at the end of
 the jump-table.
 @end defmac
 
+@hook TARGET_ASM_POST_CFI_STARTPROC
+
 @hook TARGET_ASM_EMIT_UNWIND_LABEL
 
 @hook TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL
index cb5cc0129e1f622a183aa2c9c67c46d4d1127964..b238105699111f95b23acc3319d3cd581a1faa23 100644 (file)
@@ -969,6 +969,8 @@ dwarf2out_do_cfi_startproc (bool second)
 
   fprintf (asm_out_file, "\t.cfi_startproc\n");
 
+  targetm.asm_out.post_cfi_startproc (asm_out_file, current_function_decl);
+
   /* .cfi_personality and .cfi_lsda are only relevant to DWARF2
      eh unwinders.  */
   if (targetm_common.except_unwind_info (&global_options) != UI_DWARF2)
index 780cc1e086312d17647a4548afb0e583e9f86df9..46bf2a8cee0c755a94cbd42580974fb1e8e95038 100644 (file)
@@ -276,6 +276,11 @@ hook_void_tree (tree)
 {
 }
 
+void
+hook_void_FILEptr_tree (FILE *, tree)
+{
+}
+
 void
 hook_void_rtx_tree (rtx, tree)
 {
index 0ed5b952b48ee019eae6f96659d0c5278b5339ae..bcfc2312516e439cf811737abab608aac14d1c54 100644 (file)
@@ -82,6 +82,7 @@ extern void hook_void_FILEptr_constcharptr_const_tree (FILE *, const char *,
                                                       const_tree);
 extern bool hook_bool_FILEptr_rtx_false (FILE *, rtx);
 extern void hook_void_rtx_tree (rtx, tree);
+extern void hook_void_FILEptr_tree (FILE *, tree);
 extern void hook_void_tree (tree);
 extern void hook_void_tree_treeptr (tree, tree *);
 extern void hook_void_int_int (int, int);
index 96f37e0462bc7d8c63769abfded19da5f67a136e..c425341ac3a7d6e74a141bddcc22fed7017ee1fc 100644 (file)
@@ -93,6 +93,17 @@ when the relevant string is @code{NULL}.",
  bool, (rtx x, unsigned int size, int aligned_p),
  default_assemble_integer)
 
+/* Assembly strings required after the .cfi_startproc label.  */
+DEFHOOK
+(post_cfi_startproc,
+  "This target hook is used to emit assembly strings required by the target\n\
+after the .cfi_startproc directive.  The first argument is the file stream to\n\
+write the strings to and the second argument is the function\'s declaration.\n\
+\n\
+The default is to not output any assembly strings.",
+  void, (FILE *, tree),
+  hook_void_FILEptr_tree)
+
 /* Notify the backend that we have completed emitting the data for a
    decl.  */
 DEFHOOK