diff options
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index d612157af47..3e8853df7ef 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -209,11 +209,37 @@ create_stmt_ann (tree t) /* Since we just created the annotation, mark the statement modified. */ ann->modified = true; + ann->uid = inc_gimple_stmt_max_uid (cfun); t->base.ann = (tree_ann_t) ann; return ann; } +/* Renumber all of the gimple stmt uids. */ + +void +renumber_gimple_stmt_uids (void) +{ + basic_block bb; + + set_gimple_stmt_max_uid (cfun, 0); + FOR_ALL_BB (bb) + { + block_stmt_iterator bsi; + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + { + tree stmt = bsi_stmt (bsi); + /* If the stmt has an annotation, then overwrite it, if not, + the process of getting it will set the number + properly. */ + if (has_stmt_ann (stmt)) + set_gimple_stmt_uid (stmt, inc_gimple_stmt_max_uid (cfun)); + else + get_stmt_ann (stmt); + } + } +} + /* Create a new annotation for a tree T. */ tree_ann_common_t |