From: bothner Date: Thu, 16 Apr 1998 11:49:07 +0000 (+0000) Subject: � X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95790ad9537afcb3918f4f23cdd5ab609b61b9cb;p=platform%2Fupstream%2Flinaro-gcc.git � * tree.c (build_expr_wfl): Use NULL_TREE if the file name is NULL. Propagate TREE_SIDE_EFFECTS and TREE_TYPE iff the encapsulated node is non NULL. Cache last file name and file name identifier node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19234 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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; }