diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -3760,7 +3760,6 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) TREE_TYPE (t) = type; SET_EXPR_LOCATION (t, UNKNOWN_LOCATION); TREE_OPERAND (t, 0) = node; - TREE_BLOCK (t) = NULL_TREE; if (node && !TYPE_P (node)) { TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node); @@ -10826,17 +10825,33 @@ walk_tree_without_duplicates_1 (tree *tp, walk_tree_fn func, void *data, } -tree * +tree tree_block (tree t) { char const c = TREE_CODE_CLASS (TREE_CODE (t)); if (IS_EXPR_CODE_CLASS (c)) - return &t->exp.block; + return LOCATION_BLOCK (t->exp.locus); gcc_unreachable (); return NULL; } +void +tree_set_block (tree t, tree b) +{ + char const c = TREE_CODE_CLASS (TREE_CODE (t)); + + if (IS_EXPR_CODE_CLASS (c)) + { + if (b) + t->exp.locus = COMBINE_LOCATION_DATA (line_table, t->exp.locus, b); + else + t->exp.locus = LOCATION_LOCUS (t->exp.locus); + } + else + gcc_unreachable (); +} + /* Create a nameless artificial label and put it in the current function context. The label has a location of LOC. Returns the newly created label. */ |