[PATCH] D111770: [DebugInfo] When the enum type causes ODR violation, skip ODRUniquing

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 17:19:26 PDT 2021


ychen created this revision.
ychen added reviewers: probinson, dexonsmith, aprantl, dblaikie.
Herald added a subscriber: hiraditya.
ychen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Otherwize, ODRUniquing would map some member method/variable MDNodes
to have enum type DIScope, resulting in invalid debug info and bad
DWARF.

- Add the check in Verifier that 'scope:' operand could not be enum

type.

- Exclude enum type from ODRUniquing when ODR is detected so that the

debuginfo/DWARF is well-formed. The other option is to report the error
to the user considering this may imply correctness issue
(https://crbug.com/630335) however `ODRUniquing` don't do this currently.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111770

Files:
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/test/Linker/debug-info-bad-enum.ll
  llvm/test/Verifier/dbg-invalid-enum-as-scope.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111770.379560.patch
Type: text/x-patch
Size: 5721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211014/770b5c60/attachment.bin>


More information about the llvm-commits mailing list