aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 5b92459..95680ba 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3577,6 +3577,16 @@ set_expr_locus (tree node, source_location *loc)
else
EXPR_CHECK (node)->exp.locus = *loc;
}
+
+/* Like SET_EXPR_LOCATION, but make sure the tree can have a location.
+
+ LOC is the location to use in tree T. */
+
+void protected_set_expr_location (tree t, location_t loc)
+{
+ if (t && t != error_mark_node && CAN_HAVE_LOCATION_P (t))
+ SET_EXPR_LOCATION (t, loc);
+}
/* Return a declaration like DDECL except that its DECL_ATTRIBUTES
is ATTRIBUTE. */