This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Apply conditional down cast to cgraph.h et.al.
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Lawrence Crowl <crowl at googlers dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Diego Novillo <dnovillo at google dot com>, Marc Glisse <marc dot glisse at inria dot fr>, Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Fri, 02 Nov 2012 09:27:08 +0100
- Subject: Re: [patch] Apply conditional down cast to cgraph.h et.al.
- References: <CAGqM8fYQ3xO8cxNRH=C0+Or-8U8acdM6upqE4g1DD7GNvBKKkQ@mail.gmail.com> <CAGqM8fZS9psWTpP9bfsA12yaeFLX8wo_NoEYOvvDW+jodH732Q@mail.gmail.com> <CAGqM8fZS2EfmNs15hkwuyFRaZXFhguoz4b6ww=ZEcd+D=9Bm3g@mail.gmail.com>
> Index: gcc/ChangeLog
>
> 2012-10-31 Lawrence Crowl <crowl@google.com>
>
> * is-a.h: New.
> (is_a <T> (U*)): New. Test for is-a relationship.
> (as_a <T> (U*)): New. Treat as a derived type.
> (dyn_cast <T> (U*)): New. Conditionally cast based on is_a.
> * cgraph.h (varpool_node): Rename to varpool_node_for_decl.
> Adjust callers to match.
> (is_a_helper <cgraph_node>::test (symtab_node_def *)): New.
> (is_a_helper <varpool_node>::test (symtab_node_def *)): New.
> (symtab_node_def::try_function): New. Change most calls to
> symtab_function_p with calls to dyn_cast <cgraph_node> (p).
> (symtab_node_def::try_variable): New. Change most calls to
> symtab_variable_p with calls to dyn_cast <varpool_node> (p).
> (symtab_function_p): Remove. Change callers to use
> is_a <cgraph_node> (p) instead.
> (symtab_variable_p): Remove. Change callers to use
> is_a <varpool_node> (p) instead.
> * cgraph.c (cgraph_node_for_asm): Remove redundant call to
> symtab_node_for_asm.
> * cgraphunit.c (symbol_finalized_and_needed): New.
> (symbol_finalized): New.
> (cgraph_analyze_functions): Split complicated conditionals out into
> above new functions.
> * Makefile.in (CGRAPH_H): Add is-a.h as used by cgraph.h.
The installed patch touches the ada/, cp/ and lto/ subdirectories without
modifying their ChangeLog files. Please add the missing entries.
[Some people, like me, do use these ChangeLogs to synchronize trees]
--
Eric Botcazou