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

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 20 00:45:40 PDT 2018


JDevlieghere marked 2 inline comments as done.
JDevlieghere added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:461-464
+      if (DieTag == DW_TAG_inlined_subroutine && RefTag == DW_TAG_subprogram)
+        break;
+      if (DieTag == DW_TAG_variable && RefTag == DW_TAG_member)
+        break;
----------------
dblaikie wrote:
> Should there be a positive case for tags are the same? (things like a member subprogram - DieTag and RefTag would both be subprogram?) Or a function defined in a namespace (I think GCC puts the declaration in a namespace, the definition at global scope - I forget what Clang does tehre - maybe it doesn't produce a declaration so there's nothing to check there?)
> 
> Have you run this check over a large codebase to see that it doesn't produce false positives?
We didn't account for the case where the tags were the same, as you suggested. I ran the verifier on a ToT clang and on a gcc-generated binary (some xml lib I had around) and didn't see any false positives. 


https://reviews.llvm.org/D38719





More information about the llvm-commits mailing list