[PATCH] D73086: [WIP][DWARF5] Added support for debug_macro section parsing and dumping in llvm-dwarfdump.

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 06:55:47 PDT 2020


SouraVX added a comment.

In D73086#1921504 <https://reviews.llvm.org/D73086#1921504>, @jhenderson wrote:

> This might be a legacy thing, but it looks like `DWARFSection` is just a wrapper around a `StringRef`. Could they all use `StringRef` (or `DWARFSection`), instead of having some use one and some use the other? That might require an additional change or two, but it seems pointless having the two types to me.


The rationale behind putting some section as `StringRef` and some as `DWARFSection` is based on relocations `macinfo` doesn't have relocation `macro` does have relocations hence (I represented it that way).
`DWARFDataExtractor ` also seems to have different handling(2 constructors) for both cases(relocation and normal cases).
Besides your suggestion to use one common thing(taking StringRef for this case) for both(macro/macinfo) will introduce inconsistency(might also introduce some bugs). Since their are already some sections `str` `line_str` and more represented as `StringRef` while others as `DWARFSection`.


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

https://reviews.llvm.org/D73086





More information about the llvm-commits mailing list