[Lldb-commits] [clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

David Blaikie via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 18 11:13:18 PDT 2024


dwblaikie wrote:

> That would mean if someone wrote `struct Empty {}; struct Z { Empty a,b,c; }`, we'd lower it to `{ [3 x i8] }` instead of `{%Empty, %Empty, %Empty}`, which is a bit ugly. Other than that, sure, I guess we could do that.

Ah, fair enough. Glad to understand and I don't feel /super/ strongly either way. Though it might help with confidence if codegen didn't depend on this property at all (that it depends on the property a bit may make it harder to detect if later codegen depends on the property in a real/ABI-breaking way).

The struct layout validation stuff that @Michael137 found may be adequate to provide confidence (especially combined with fuzzing, maybe) without the need for the codegen-is-zero-length-independent invariant.

I don't feel too strongly - mostly happy with whatever Clang owners are happy with.

https://github.com/llvm/llvm-project/pull/93809


More information about the lldb-commits mailing list