diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2010-10-06 15:48:25 +0000 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2010-10-06 15:48:25 +0000 |
commit | 363aab219509999ae48a7c8e5c515e7d82f08474 (patch) | |
tree | 24bd13baa0b098c0036174293c6c3deeab54b3e0 /gcc/fortran/trans-array.c | |
parent | 1b4544b729d2d4d159df843afa8252af13fb2e55 (diff) | |
download | gcc-363aab219509999ae48a7c8e5c515e7d82f08474.zip gcc-363aab219509999ae48a7c8e5c515e7d82f08474.tar.gz gcc-363aab219509999ae48a7c8e5c515e7d82f08474.tar.bz2 |
trans.c (gfc_restore_backend_locus): New function.
2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
* trans.c (gfc_restore_backend_locus): New function.
(gfc_get_backend_locus): Renamed to ...
(gfc_save_backend_locus): ... this.
* trans.h (gfc_restore_backend_locus, gfc_get_backend_locus,
gfc_save_backend_locus): Same.
* trans-array.c (gfc_trans_g77_array, gfc_trans_dummy_array_bias,
gfc_trans_deferred_array): Rename gfc_get_backend_locus to
gfc_save_backend_locus.
(gfc_trans_dummy_array_bias): Call gfc_restore_backend_locus at the
end.
(gfc_trans_g77_array, gfc_trans_deferred_array): Use
gfc_restore_backend_locus instead of gfc_set_backend_locus.
(gfc_trans_deferred_array): Call gfc_restore_backend_locus on early
return.
* trans-decl.c (gfc_get_extern_function_decl, build_entry_thunks,
gfc_trans_deferred_vars):
Rename gfc_get_backend_locus to gfc_save_backend_locus.
Use gfc_restore_backend_locus insted of gfc_set_backend_locus.
From-SVN: r165045
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 93d9b79..271b37c 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -4536,10 +4536,10 @@ gfc_trans_g77_array (gfc_symbol * sym, gfc_wrapped_block * block) locus loc; tree offset; tree tmp; - tree stmt; + tree stmt; stmtblock_t init; - gfc_get_backend_locus (&loc); + gfc_save_backend_locus (&loc); gfc_set_backend_locus (&sym->declared_at); /* Descriptor type. */ @@ -4568,7 +4568,7 @@ gfc_trans_g77_array (gfc_symbol * sym, gfc_wrapped_block * block) } stmt = gfc_finish_block (&init); - gfc_set_backend_locus (&loc); + gfc_restore_backend_locus (&loc); /* Add the initialization code to the start of the function. */ @@ -4629,7 +4629,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, return; } - gfc_get_backend_locus (&loc); + gfc_save_backend_locus (&loc); gfc_set_backend_locus (&sym->declared_at); /* Descriptor type. */ @@ -4921,6 +4921,8 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, /* We don't need to free any memory allocated by internal_pack as it will be freed at the end of the function by pop_context. */ gfc_add_init_cleanup (block, stmtInit, stmtCleanup); + + gfc_restore_backend_locus (&loc); } @@ -6500,7 +6502,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) return; } - gfc_get_backend_locus (&loc); + gfc_save_backend_locus (&loc); gfc_set_backend_locus (&sym->declared_at); descriptor = sym->backend_decl; @@ -6513,6 +6515,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) gfc_trans_static_array_pointer (sym); gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE); + gfc_restore_backend_locus (&loc); return; } @@ -6550,7 +6553,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node); gfc_init_block (&cleanup); - gfc_set_backend_locus (&loc); + gfc_restore_backend_locus (&loc); /* Allocatable arrays need to be freed when they go out of scope. The allocatable components of pointers must not be touched. */ |