[PATCH] D143967: [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF

David Faust via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 15 10:29:19 PDT 2023


dfaust added a comment.



> in the final BTF, type tags have to precede CVR modifiers, e.g. TYPE_TAG 'foo' -> CONST -> INT. Right now pahole does not do any reordering, so I ended up putting the type tag annotations on the DIE with outermost modifier. Will see if DI maintainers would be ok with this.

Ok I was not aware of that requirement.
Internally GCC converts DWARF representation to BTF for BTF emission so we get (for the volatile example):

  [1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
  [2] TYPE_TAG '__b' type_id=1
  [3] VOLATILE '(anon)' type_id=2
  [4] VAR 'b' type_id=3, linkage=global

i.e. `VOLATILE -> TYPE_TAG -> INT` which doesn't meet the above requirement that type tags precede CVR modifiers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143967



More information about the cfe-commits mailing list