eddyz87 added a comment.

In D143967#4197041 <https://reviews.llvm.org/D143967#4197041>, @dfaust wrote:

> The way I see it both 'volatile' and the type tag are modifying 'int' type 
> here, so the annotation DIE more properly fits as a child of 'int' rather 
> than the 'volatile'.
>
> I don't think we discussed this particular case, and I'm not sure whether 
> there is any precedent here.
>
> WDYT @eddyz87, @jemarch ?

This is related to my previous comment. Kernel BTF parser wants all type tags 
to precede modifiers (see this 
<https://elixir.bootlin.com/linux/latest/source/kernel/bpf/btf.c#L5348> code). 
So such reordering will have to happen either during DWARF generation or by 
`pahole`. Currently `pahole` is "dumb" in a sense that it reflects DWARF 
structure in BTF effectively one-to-one. Adding such rewrite at a `pahole` 
level is possible but one-to-one mapping to DWARF would be lost, so the tool 
would require significant changes.

So, at least for LLVM its a tradeoff, either do it in the compiler (less code), 
or in the pahole (more code). I opted for less code :) If you think that this 
is conceptually unacceptable, I'll do the change on the pahole side (DI 
maintainers on LLVM side might agree, the patch has not been reviewed yet).

Another option would be to modify the kernel, but this might impede backwards 
compatibility.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143967

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to