From 95790ad9537afcb3918f4f23cdd5ab609b61b9cb Mon Sep 17 00:00:00 2001 From: bothner Date: Thu, 16 Apr 1998 11:49:07 +0000 Subject: [PATCH] =?utf8?q?=EF=BF=BD=20=20=20=20=20=20=20=20=20*=20tree.c?= =?utf8?q?=20(build=5Fexpr=5Fwfl):=20Use=20NULL=5FTREE=20if=20the=20file?= =?utf8?q?=20name=20is=20NULL.=20=20=20=20=20=20=20=20=20Propagate=20TREE?= =?utf8?q?=5FSIDE=5FEFFECTS=20and=20TREE=5FTYPE=20iff=20the=20encapsulated?= =?utf8?q?=20=20=20=20=20=20=20=20=20node=20is=20non=20NULL.=20Cache=20las?= =?utf8?q?t=20file=20name=20and=20file=20name=20identifier=20node.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19234 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/tree.c b/gcc/tree.c index c0b1e34..20805d5 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3232,12 +3232,23 @@ build_expr_wfl (node, file, line, col) char *file; int line, col; { + static char *last_file = 0; + static tree last_filenode = NULL_TREE; register tree wfl = make_node (EXPR_WITH_FILE_LOCATION); + EXPR_WFL_NODE (wfl) = node; - EXPR_WFL_FILENAME_NODE (wfl) = get_identifier (file); EXPR_WFL_SET_LINECOL (wfl, line, col); - TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node); - TREE_TYPE (wfl) = TREE_TYPE (node); + if (file != last_file) + { + last_file = file; + last_filenode = file ? get_identifier (file) : NULL_TREE; + } + EXPR_WFL_FILENAME_NODE (wfl) = last_filenode; + if (node) + { + TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node); + TREE_TYPE (wfl) = TREE_TYPE (node); + } return wfl; } -- 2.7.4