[llvm] [LLVM][DebugInfo] Allow ExtraData field to be a node reference (PR #165023)

Laxman Sole via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 31 16:58:19 PDT 2025


laxmansole wrote:

> > > That said, this area does seem poorly specified. The langref only briefly mentions the extraData field and the verifier doesn't complain. I think in an ideal world the verifier would have complained about the tuple extraData, rather than hitting an assert later.
> > 
> > 
> > Verifier didn't complain about the tuple `extraData` because that is a valid IR if the `tag` in `!DIDerivedType` is `DW_TAG_ptr_to_member_type` and is handled correctly in the backend.
> 
> But !4 in the given example isn't a tuple, is it? Is there something that prevents us from adding such check?

My bad— I confused `MDNode` with `MDTuple`. 
In this example, `extraData: !14` accepts `!14 = !{!15, !16}` - https://github.com/llvm/llvm-project/blob/c87e3c922d956c0d4a6d9910094a2e060f018827/llvm/test/DebugInfo/X86/template-alias.ll#L58-L66

We'll need to handle the verifier checks separately for different tags and also add constraints in this case, such as preventing nested tuples. If we decide to add those, we can include them in a separate follow-up PR.



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


More information about the llvm-commits mailing list