This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Refactor the code to remove IS_UNKNOWN_LOCATION
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 26 Sep 2012 11:20:44 +0200
- Subject: Re: [PATCH] Refactor the code to remove IS_UNKNOWN_LOCATION
- References: <CAO2gOZUCAxbOawnfvM_xfv2DW6tNz0CKajDz8cF16emqeAXwww@mail.gmail.com>
On Wed, Sep 26, 2012 at 6:29 AM, Dehao Chen <dehao@google.com> wrote:
> IS_UNKNOWN_LOCATION is very misleading. This patch removes this macro
> from input.h. For sites when checking LOCUS is intended, we explicit
> use LOCATION_LOCUS and compare it to UNKNOWN_LOCATION.
>
> Bootstrapped and passed all gcc regression tests.
>
> Ok for trunk?
I thought that
LOCATION_LOCUS (loc) != UNKNOWN_LOCATION
was very verbose and maybe renaming IS_UNKNOWN_LOCATION to
HAS_UNKNOWN_LOCATION_LOCUS (loc)
would be an improvement. But I see that this may be as confusing as
the original IS_UNKNOWN_LOCATION.
Thus the patch is ok if nobody objects within 24h.
Thanks,
Richard.
> Thanks,
> Dehao
>
> gcc/ChangeLog:
>
> 2012-09-25 Dehao Chen <dehao@google.com>
>
> * gcc/tree.h (tree_constructor): Remove IS_UNKNOWN_LOCATION.
> (extern void protected_set_expr_location): Likewise.
> (function_args_iter_next): Likewise.
> (inlined_function_outer_scope_p): Likewise.
> * gcc/input.h (IS_UNKNOWN_LOCATION): Likewise.
> * gcc/fold-const.c (expr_location_or): Likewise.
> * gcc/lto-cgraph.c (output_node_opt_summary): Likewise.
> * gcc/dwarf2out.c (add_src_coords_attributes): Likewise.
> * gcc/tree-eh.c (lower_try_finally_dup_block): Likewise.
> * gcc/profile.c (branch_prob):
> * gcc/cfgexpand.c (expand_gimple_cond): Likewise.
> (expand_gimple_basic_block): Likewise.
> (construct_exit_block): Likewise.
> (gimple_expand_cfg): Likewise.
> * gcc/cfgcleanup.c (try_forward_edges): Likewise.
> * gcc/tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
> (dump_scope_block): Likewise.
> * gcc/ipa-prop.c (ipa_write_jump_function): Likewise.
> * gcc/rtl.h (extern void rtl_check_failed_flag): Likewise.
> * gcc/gimple.h (gimple_set_location): Likewise.
> (gimple_has_location): Likewise.
> * gcc/cfgrtl.c (unique_locus_on_edge_between_p): Likewise.
> (force_nonfallthru_and_redirect): Likewise.
> (fixup_reorder_chain): Likewise.
> (cfg_layout_merge_blocks): Likewise.