aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@sendai.cygnus.com>1998-04-16 04:49:07 -0700
committerPer Bothner <bothner@gcc.gnu.org>1998-04-16 04:49:07 -0700
commit9fe9a2e1a0476ab249415e5c96d6ec1e4bd91d6a (patch)
treea1f872f6051fc2ce643a310b5495e58673d04083 /gcc/tree.c
parenta62e870c5b40652e88875dd1bd5de02b7162c4e3 (diff)
downloadgcc-9fe9a2e1a0476ab249415e5c96d6ec1e4bd91d6a.zip
gcc-9fe9a2e1a0476ab249415e5c96d6ec1e4bd91d6a.tar.gz
gcc-9fe9a2e1a0476ab249415e5c96d6ec1e4bd91d6a.tar.bz2
tree.c (build_expr_wfl): Use NULL_TREE if the file name is NULL.
� * 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. From-SVN: r19234
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c17
1 files 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;
}