aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c
index f5a3102..097aea4 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -277,6 +277,7 @@ static void reorder_fix_fragments PARAMS ((tree));
static tree blocks_nreverse PARAMS ((tree));
static int all_blocks PARAMS ((tree, tree *));
static tree *get_block_vector PARAMS ((tree, int *));
+extern tree debug_find_var_in_block_tree PARAMS ((tree, tree));
/* We always define `record_insns' even if its not used so that we
can always export `prologue_epilogue_contains'. */
static void record_insns PARAMS ((rtx, varray_type *)) ATTRIBUTE_UNUSED;
@@ -6051,6 +6052,29 @@ number_blocks (fn)
return;
}
+
+/* If VAR is present in a subblock of BLOCK, return the subblock. */
+
+tree
+debug_find_var_in_block_tree (var, block)
+ tree var;
+ tree block;
+{
+ tree t;
+
+ for (t = BLOCK_VARS (block); t; t = TREE_CHAIN (t))
+ if (t == var)
+ return block;
+
+ for (t = BLOCK_SUBBLOCKS (block); t; t = TREE_CHAIN (t))
+ {
+ tree ret = debug_find_var_in_block_tree (var, t);
+ if (ret)
+ return ret;
+ }
+
+ return NULL_TREE;
+}
/* Allocate a function structure and reset its contents to the defaults. */