[PATCH] D38719: [llvm-dwarfdump] Verify compatible TAG for attributes.

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 12:06:39 PDT 2017



> On Oct 10, 2017, at 6:24 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Tue, Oct 10, 2017 at 10:06 AM Jonas Devlieghere via Phabricator <reviews at reviews.llvm.org <mailto:reviews at reviews.llvm.org>> wrote:
> JDevlieghere marked 2 inline comments as done.
> JDevlieghere added inline comments.
> 
> 
> ================
> Comment at: lib/DebugInfo/DWARF/DWARFVerifier.cpp:423
> +    // Make sure specification and abstract origin have compatible tag.
> +    if (auto Offset = AttrValue.Value.getAsReference()) {
> +
> ----------------
> dblaikie wrote:
> > Can you use DWARFDie::getAttributeValueAsReferencedDie here, perhaps?
> Unfortunately not, because this makes use of `getUnitForOffset` which in turn uses a list of units that isn't build when doing the verification.
> 
> Not sure I understand - this code calls getDIEForOffset, which calls getUnitForOffset as well. So why would one path be usable and the other not?

I would have to double check with the code in front of me, but it uses an upper_bound to find the right unit based on the offset, and this code path doesn’t populate that list. I noticed this earlier when I was trying to understand why the name of the subroutine is shown when dumping the debug info but not when running the verifier. I think this is the result of only considering one unit at a time when verifying, but I didn’t dig much deeper once I had found the explanation. 

>  
> Furthermore, this is (probably) slightly more efficient as we already have the attribute value and therefore do not need to do any indirections via the abbrev declaration.
> 
> 
> https://reviews.llvm.org/D38719 <https://reviews.llvm.org/D38719>
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171010/98d5500a/attachment.html>


More information about the llvm-commits mailing list