aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/doc/tm.texi9
-rw-r--r--gcc/doc/tm.texi.in2
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/hooks.c5
-rw-r--r--gcc/hooks.h1
-rw-r--r--gcc/target.def11
7 files changed, 39 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index afbdf75..6ce0658 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index e348f0a..c9a8560 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -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
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index f1ad80d..2205e2d 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -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
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index cb5cc01..b238105 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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)
diff --git a/gcc/hooks.c b/gcc/hooks.c
index 780cc1e..46bf2a8 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -277,6 +277,11 @@ hook_void_tree (tree)
}
void
+hook_void_FILEptr_tree (FILE *, tree)
+{
+}
+
+void
hook_void_rtx_tree (rtx, tree)
{
}
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 0ed5b95..bcfc231 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -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);
diff --git a/gcc/target.def b/gcc/target.def
index 96f37e0..c425341 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -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