On 01/30/2015 02:04 PM, Jason Merrill wrote: > On 01/30/2015 03:36 PM, Aldy Hernandez wrote: >> /* It is possible to have both DECL_ABSTRACT_P and DECLARATION be >> true if we >> started to generate the abstract instance of an inline, decided >> to output >> its containing class, and proceeded to emit the declaration of >> the inline >> from the member list for the class. If so, DECLARATION takes >> priority; >> we'll get back to the abstract instance when done with the >> class. */ > > This comment is out of date; in this case decl_ultimate_origin will > return NULL_TREE, so origin is null, so we shouldn't need to deal with > this here. > >> + /* ?? We must not reset `origin', so C++ clones get a proper >> + DW_AT_abstract_origin tagged DIE further on. */ >> +#if 0 >> /* The class-scope declaration DIE must be the primary DIE. */ >> if (origin && declaration && class_or_namespace_scope_p (context_die)) >> { >> origin = NULL; >> gcc_assert (!old_die); >> } >> +#endif > > So I think this block is unnecessary. Sweet, removed. >> Obviously, now we will get more DIEs than before (complete >> constructors, base constructors, and what have yous). Whereas >> previously we only generated a DIE for the used ones. > > Hmm, that's unfortunate. > > What if we leave the clone skipping alone here and emit early debug > about all reachable functions in > symbol_table::finalize_compilation_unit, between analyze_functions() and > compile()? Now you're just messing with me :). I'm not a huge fan of doing things so late, but in the interest of not having to clean things up later... I have implemented your suggestion, and in the process got rid of some code from the last revision that is no longer necessary. I'm not saying it wasn't correct, it's just that some asserts were no longer triggered, etc, so no point in touching more things than I need to. FYI, I am using FOR_EACH_FUNCTION_WITH_GIMPLE_BODY in symbol_table::finalize_compilation_unit() instead of FOR_EACH_DEFINED_FUNCTION because: - FOR_EACH_DEFINED_FUNCTION iterates through comp_ctor and base_ctor, whereas mainline is only iterating through base_ctor (i.e. more DIEs than expected). - FOR_EACH_FUNCTION_WITH_GIMPLE_BODY iterates only through the base_ctor as in mainline. - I also tried FOR_EACH_DEFINED_FUNCTION with node->get_availability() > AVAIL_INTERPOSABLE, but that also iterated through more ctors than mainline. Though all approaches are better than doing it in gen_member_die(): /* Don't include clones in the member list. */ if (DECL_ABSTRACT_ORIGIN (member)) continue; This approach was the worst, iterating through two base_ctors and 2 comp_ctors. How is this one? Aldy