[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 23:17:54 PDT 2021


yonghong-song added a comment.

> Ah, yeah, I see what you mean - that does seem sort of unfortunate. Is it possible these attributes could only appear on typedefs and they'd be more readily carried through that without needing extra typeloc tracking? (sorry for not having read back through the rest of the review - which may've started there and ended up here as a more general form of the attribute?)

For the question, "is it possible these attributes could only appear on typedefs?" The answer is "not really possible". We are targeting existing linux kernel where existing type attributes (__user, __rcu, ...) have been used in places other than typedef quite extensively (e.g., function argument type, function return type, field type, etc.).

In one of my earlier prototypes, I put the tag string itself in AttributedType and with this we can avoid TypeLoc, but I understand this is not conventional usage and that is why we do through TypeLoc mechanism. @aaron.ballman can further comment on this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111199



More information about the llvm-commits mailing list