From 5a13c1e6ea354b9b953244b4ce65560248550f0c Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Mon, 12 Feb 2007 21:01:33 +0000 Subject: [PATCH] * tree.h (DECL_IGNORED_P): Document further effect for FUNCTION_DECL. * cgraphunit.c (cgraph_expand_function): If DECL_IGNORED_P is set on the function, temporarily point the debug interface to the null one. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121861 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/cgraphunit.c | 16 ++++++++++++++++ gcc/tree.h | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7a3bf3966b..bd541e5b676 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2007-02-12 Eric Botcazou + * tree.h (DECL_IGNORED_P): Document further effect for FUNCTION_DECL. + * cgraphunit.c (cgraph_expand_function): If DECL_IGNORED_P is set on + the function, temporarily point the debug interface to the null one. + +2007-02-12 Eric Botcazou + * dwarf2out.c (round_up_to_align): New static function. (field_byte_offset): Use it to round the offset. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 2d1ecda64ac..f7274ee1fcf 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -984,6 +984,8 @@ cgraph_mark_functions_to_output (void) static void cgraph_expand_function (struct cgraph_node *node) { + enum debug_info_type save_write_symbols = NO_DEBUG; + const struct gcc_debug_hooks *save_debug_hooks = NULL; tree decl = node->decl; /* We ought to not compile any inline clones. */ @@ -994,6 +996,14 @@ cgraph_expand_function (struct cgraph_node *node) gcc_assert (node->lowered); + if (DECL_IGNORED_P (decl)) + { + save_write_symbols = write_symbols; + write_symbols = NO_DEBUG; + save_debug_hooks = debug_hooks; + debug_hooks = &do_nothing_debug_hooks; + } + /* Generate RTL for the body of DECL. */ lang_hooks.callgraph.expand_function (decl); @@ -1001,6 +1011,12 @@ cgraph_expand_function (struct cgraph_node *node) /* ??? Can happen with nested function of extern inline. */ gcc_assert (TREE_ASM_WRITTEN (node->decl)); + if (DECL_IGNORED_P (decl)) + { + write_symbols = save_write_symbols; + debug_hooks = save_debug_hooks; + } + current_function_decl = NULL; if (!cgraph_preserve_function_body_p (node->decl)) { diff --git a/gcc/tree.h b/gcc/tree.h index c672d94d0c0..50b014962ad 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2540,7 +2540,8 @@ struct tree_memory_partition_tag GTY(()) (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from) /* Nonzero for a given ..._DECL node means that the name of this node should - be ignored for symbolic debug purposes. */ + be ignored for symbolic debug purposes. Moreover, for a FUNCTION_DECL, + the body of the function should also be ignored. */ #define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag) /* Nonzero for a given ..._DECL node means that this node represents an -- 2.11.4.GIT