diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-31 08:08:28 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-31 08:08:28 +0000 |
commit | ebd052aa5e425689ecefa34fb5d54c7be996e99f (patch) | |
tree | 1a57ffb7b4260af4aa9fb6fed0f37ca80de3486d /gcc/tree-ssa-structalias.c | |
parent | dc81c7363f2304d2e67b8d1064e8f7ef5e451baa (diff) | |
download | gcc-ebd052aa5e425689ecefa34fb5d54c7be996e99f.tar.gz |
Improve readability and structure of create_function_info_for
2015-10-31 Tom de Vries <tom@codesourcery.com>
* tree-ssa-structalias.c (create_function_info_for): Make sure prev_vi
updating is alap, and seperated from preceding code. Make sure
insert_vi_for_tree is seperated from surrounding code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index f482c72396c..a67e7f3e5e9 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -5452,6 +5452,7 @@ create_function_info_for (tree decl, const char *name, bool add_id) clobbervi->fullsize = vi->fullsize; clobbervi->is_full_var = true; clobbervi->is_global_var = false; + gcc_assert (prev_vi->offset < clobbervi->offset); prev_vi->next = clobbervi->id; prev_vi = clobbervi; @@ -5466,6 +5467,7 @@ create_function_info_for (tree decl, const char *name, bool add_id) usevi->fullsize = vi->fullsize; usevi->is_full_var = true; usevi->is_global_var = false; + gcc_assert (prev_vi->offset < usevi->offset); prev_vi->next = usevi->id; prev_vi = usevi; @@ -5488,10 +5490,12 @@ create_function_info_for (tree decl, const char *name, bool add_id) chainvi->fullsize = vi->fullsize; chainvi->is_full_var = true; chainvi->is_global_var = false; + + insert_vi_for_tree (fn->static_chain_decl, chainvi); + gcc_assert (prev_vi->offset < chainvi->offset); prev_vi->next = chainvi->id; prev_vi = chainvi; - insert_vi_for_tree (fn->static_chain_decl, chainvi); } /* Create a variable for the return var. */ @@ -5517,11 +5521,13 @@ create_function_info_for (tree decl, const char *name, bool add_id) resultvi->is_full_var = true; if (DECL_RESULT (decl)) resultvi->may_have_pointers = true; + + if (DECL_RESULT (decl)) + insert_vi_for_tree (DECL_RESULT (decl), resultvi); + gcc_assert (prev_vi->offset < resultvi->offset); prev_vi->next = resultvi->id; prev_vi = resultvi; - if (DECL_RESULT (decl)) - insert_vi_for_tree (DECL_RESULT (decl), resultvi); } /* Set up variables for each argument. */ @@ -5547,14 +5553,15 @@ create_function_info_for (tree decl, const char *name, bool add_id) argvi->fullsize = vi->fullsize; if (arg) argvi->may_have_pointers = true; + + if (arg) + insert_vi_for_tree (arg, argvi); + gcc_assert (prev_vi->offset < argvi->offset); prev_vi->next = argvi->id; prev_vi = argvi; if (arg) - { - insert_vi_for_tree (arg, argvi); - arg = DECL_CHAIN (arg); - } + arg = DECL_CHAIN (arg); } /* Add one representative for all further args. */ @@ -5578,6 +5585,7 @@ create_function_info_for (tree decl, const char *name, bool add_id) argvi->is_full_var = true; argvi->is_heap_var = true; argvi->fullsize = vi->fullsize; + gcc_assert (prev_vi->offset < argvi->offset); prev_vi->next = argvi->id; prev_vi = argvi; |