[llvm] [BPF] Support for `DW_TAG_variant_part` in BTF generation (PR #155783)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 9 11:56:07 PDT 2025


eddyz87 wrote:

> Oh, so in your case rustc didn't emit `undef` in the constant, interesting. In my case, the IR fragments defining constants look like:
> 
> [vadorovsky at 413a98a#diff-f411e8cbe94fed63916ca9eebac7652eddbb2db4770934eb94c26632216cbc58R42](https://github.com/vadorovsky/llvm-project/commit/413a98a961841510f813244f454a34ef6e9f116a#diff-f411e8cbe94fed63916ca9eebac7652eddbb2db4770934eb94c26632216cbc58R42)
> 
> The difference in our codes that I added one more constant for the other variant and used `no_mangle` attribute.

It's a backend test. When I write such tests I start from something generated by frontend but cut away any unrelated stuff. In this particular case the only relevant thing is the structure of debug information generated for variant/variant_part. You can drop initialization from those globals and it would still be fine for the backend test.
 
> I'm AFK ATM. Tomorrow I will try to produce a similar IR without `undef`, or just use your IR in the test. What Rust version did you use? I used the latest nightly from a week ago.

rustc version 1.88.0 (6b00bc388 2025-06-23) (Red Hat 1.88.0-1.el9




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


More information about the llvm-commits mailing list