On 09/07/2016 11:30 AM, Richard Biener wrote:
Ok, had time to look at this issue again. I see the patch works like dwarf2out works currently with respect to DIE creation order and re-location.
Thank you very much for helping me with this again! So yes, that was the intent of the patch.
this might be incomplete though for the case where it's say typedef const T X; thus the type of decl is a qualified type? In this case the qualification might be at the correct scope but the actual type not or you just relocate the qualification but not the type DIE it refers to?
I haven’t tested this yet but I guess you are right. A complete patch should also probably see if the unqualifier type should be relocated.
That said, with the idea of early debug in place and thus giving more responsibility to the frontends I wonder in what order the Ada FE calls debug_hooks.early_global_decl ()? Maybe it's the middle-end and it should arrange for a more natural order on function nests. So I'd appreciate if you can investigate this side of the issue a bit, that is, simply avoid the bad ordering.
Reordering compilation of function nests was the first idea I had in mind when I first worked on this issue, maybe two years ago. I thought it would make sense debug info generation-wise, but I wondered if this specific order was motivated by code generation concerns.
Anyway I agree it would be a more elegant way out. As the GNU cauldron is going to keep me busy, I think I’ll investigate this way next week. Thanks again! :-)
-- Pierre-Marie de Rodat