aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-11-26 10:10:27 +0000
committerMark Wielaard <mark@gcc.gnu.org>2014-11-26 10:10:27 +0000
commit42bc3520017ef04b19bee9a6ae4fc35d55cd2537 (patch)
tree0da2d62552111f8cf417b00f86b89e8a9353c9cb /gcc/dwarf2out.c
parent7ec44c3d10c41dabcb64efc4b3225d5a1bb4d7f9 (diff)
downloadgcc-42bc3520017ef04b19bee9a6ae4fc35d55cd2537.zip
gcc-42bc3520017ef04b19bee9a6ae4fc35d55cd2537.tar.gz
gcc-42bc3520017ef04b19bee9a6ae4fc35d55cd2537.tar.bz2
DWARF add DW_AT_noreturn on noreturn function subprogram.
This implements the DWARFv5 noreturn proposal: http://dwarfstd.org/ShowIssue.php?issue=140331.1 TREE_THIS_VOLATILE on a FUNCTION_DECL node means the function does not return normally. This catches the traditional noreturn GNU attribute, the C11 _Noreturn keyword and the C++11 [[noreturn]] attribute. This relies on the DW_AT_noreturn constant defined in the DWARFv5 DRAFT: http://www.dwarfstd.org/doc/dwarf5.20141029.pdf gcc/ChangeLog * dwarf2out.c (gen_subprogram_die): Add DW_AT_noreturn when the function decl has TREE_THIS_VOLATILE. gcc/testsuite/ChangeLog * g++.dg/debug/dwarf2/noreturn-function.C: New test. * gcc.dg/debug/dwarf2/noreturn-function-attribute.c: Likewise. * gcc.dg/debug/dwarf2/noreturn-function-keyword.c: Likewise. include/ChangeLog * dwarf2.def (DW_AT_noreturn): New DWARF5 attribute. From-SVN: r218075
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 3d50ac9..25307d2 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18336,6 +18336,9 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
if (DECL_ARTIFICIAL (decl))
add_AT_flag (subr_die, DW_AT_artificial, 1);
+ if (TREE_THIS_VOLATILE (decl) && (dwarf_version >= 5 || !dwarf_strict))
+ add_AT_flag (subr_die, DW_AT_noreturn, 1);
+
add_accessibility_attribute (subr_die, decl);
}