[PATCH] D74923: [DebugInfo]: Do not start parsing macinfo/macinfo.dwo if the section's are empty.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 13:07:46 PST 2020


dblaikie added a comment.

In D74923#1885289 <https://reviews.llvm.org/D74923#1885289>, @SouraVX wrote:

> > OK, so this is a subtle divergence between how debug_macinfo is parsed and debug_macro is parsed, even though they share some code. With macinfo the looping happens here in this function and with macro the looping happens in the caller to this in dumpMacroSection.
>
>
>
> > Please fix this so macro and macinfo are handled in similar/the same way - both should build a single DWARFDebugMacro object representing all the contributions, then dump them together from there. (look at the way the existing macinfo support is written in DWARFContext - starting there/making the macro support similar)
>
> That's your remark on D73086 <https://reviews.llvm.org/D73086>, Please correct me if I've mis-understood the context here-
>  here `if (Macro)` -- Macro is `std::unique_ptr<DWARFDebugMacro> Macro` for dumping, as of now it's used for macinfo/dwo parsing/dumping. You mentioned `both should build a single DWARFDebugMacro object representing all the contributions` so that's what I'm trying to achieve here, macinfo is not present then try constructing macro if present.


I meant each (macro and macinfo) should build a single DWARFDebugMacro of their own (so two in total).

The current code in that review makes macro and macinfo handling very different - the macinfo handling builds one DWARFDebugMacro that contains all the contributions from the debug_macinfo section. Whereas the macro handling builds one DWARFDebugMacro for each contrtibution from the debug_macro section.

Instead, what I'm suggesting is that the debug_macro support should work in the same way as the debug_macinfo section - the debug_macro support should build one DWARFDebugMacro object (its own, not shared with the debug_macro support) representing all the contributions from the debug_macro section - instead of building one per contribution.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74923/new/

https://reviews.llvm.org/D74923





More information about the llvm-commits mailing list