[llvm] [BPF] Handle C++ record elements in BTF and CO-RE (PR #226717)
Maxim Skokov via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 27 12:08:22 PDT 2026
maxskokov wrote:
@tamird Agreed, di_index as a DI element index is the right contract. I pushed 714c8343faaa: the field ordinal mapping is gone, the backend looks the element up directly and only checks that it is a non-static member before mapping it to the BTF member index. An index that doesn't refer to one (e.g. a declared-only record from another producer) is still reported at the access, now also as the parent of a nested access. The CO-RE tests use DI element indices now.
I checked it end to end with #226790 applied: &s->y in struct S : Base, Base2 { static int s1; int x; void m(); int y; } is at offset 12 / 0:3, and &v->v in struct V : virtual Base { virtual void f(); int v; } at 8 / 0:1, with plain -g too.
Since this PR alone would turn the C++ CO-RE crash into a wrong offset, I'll mark it as depending on #226790. For 23.x, would you be OK with backporting #226790 together with this one?
https://github.com/llvm/llvm-project/pull/226717
More information about the llvm-commits
mailing list