On Sun, Aug 18, 2013 at 08:19:57PM +0200, Jan Hubicka wrote: > Hi, > this patch implements the type inheritance graph builder. Once the graph is > built it stays in memory and unchanged thorough the compilation (we do not > expect to invent new virtual methods during the optimization) > The graph is dumped into new IPA dump file "type-inheritance". >
[...] > * Makeifle-in (ipa-devirt.o): New. > (GTFILES): Add ipa-utils.h and ipa-devirt.c > * cgraphunit.c (decide_is_symbol_needed): Do not care about virtuals. > (analyze_functions): Look into possible targets of polymorphic call. > * dumpfile.c (dump_files): Add type-inheritance dump. > * dumpfile.h (TDI_inheritance): New. > * ipa-devirt.c: New file. > * ipa-utils.h (odr_type_d): Forward declare. > (odr_type): New type. > (build_type_inheritance_graph): Declare. > (possible_polymorphic_call_targets): Declare and introduce inline > variant when only edge is pased. > (dump_possible_polymorphic_call_targets): Likewise. > * timevar.def (TV_IPA_INHERITANCE, TV_IPA_VIRTUAL_CALL): New. > * tree.c (type_in_anonymous_namespace_p): Break out from ... > (types_same_for_odr): ... here. > * tree.h (type_in_anonymous_namespace_p): Declare. > > * g++.dg/ipa/type-inheritance-1.C: New testcase. This was bit tough to review but I do not see any problems. Perhaps we could get rid off the matched_vtables parameters but that is a very minor thing. Thanks, Martin