This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Apply conditional down cast to cgraph.h et.al.


On 11/2/12, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> 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]

Done and committed.


Update ChangeLog files as requested for cgraph change to checked down cast.


Index: gcc/cp/ChangeLog

2012-10-31  Lawrence Crowl  <crowl@google.com>

	* decl2.c (var_finalized_p): Rename varpool_node to
	varpool_node_for_decl.
	(maybe_emit_vtables): Likewise.

Index: gcc/ada/ChangeLog

2012-10-31  Lawrence Crowl  <crowl@google.com>

	* gcc-interface/utils.c (gnat_write_global_declarations):
	Rename varpool_node to varpool_node_for_decl.

Index: gcc/lto/ChangeLog

2012-10-31  Lawrence Crowl  <crowl@google.com>

	* lto.c (lto_wpa_write_files): Change symtab checking to a checked
	down-cast via dyn_cast.
	* lto-partition.c (add_symbol_to_partition_1): Likewise.
	(undo_partition): Likewise.
	(lto_balanced_map): Likewise.
	(get_symbol_class): Likewise and via is_a.
	(lto_balanced_map): Change symtab checking to is_a.


-- 
Lawrence Crowl


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]