[PATCH] D143347: [lldb][DWARF] Infer no_unique_address attribute

Michael Buch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 09:45:17 PDT 2023


Michael137 added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:1483
+    // base with all fields having [[no_unique_address]] attribute.
+    for (auto it = base_classes.rbegin(); it != base_classes.rend(); ++it) {
+      clang::CXXRecordDecl *prev_base_decl =
----------------
Michael137 wrote:
> The main problem I still see with this is that if we have something like:
> ```
> struct A : C, B {
> 
> };
> ```
> 
> then we mark `C`'s fields as empty and leave `B` as is. This still leads to the same crash later on.
> 
> Perhaps we should mark we could check the size of the struct and decide based on that which one is the "empty" one
Interestingly there was a discussion on the DWARF mailing list about this some time ago: https://www.mail-archive.com/dwarf-discuss@lists.dwarfstd.org/msg00880.html

There might be room to changing the emitted DWARF to make it easier to determine the empty structure. I will gauge opinions on this thread later today


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143347



More information about the cfe-commits mailing list