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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 4 05:53:10 PDT 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D111199#3108092 <https://reviews.llvm.org/D111199#3108092>, @yonghong-song wrote:

>> That sounds reasonable to me, but one possibility would be to change createType() and getOrCreateType() to take a TypeSourceInfo * rather than a QualType (because you can go from the TypeSourceInfo * back to the QualType by calling getType() on it). However, that could also be a heavier lift due to the number of call sites.
>
> I think this probably hard to do. If I understand correctly, TypeSourceInfo * is available for declarations. But majority of getOrCreateType() does not have TypeSourceInfo *. For example for "int ***p", "int ***" does have a corresponding TypeSourceInfo *, but "int **" or "int *" does not.  Unless you mean we can get QualType from TypeLoc which is actually true. But then the problem is currently I only handle limited cases, certainly all C++ template/Class etc. are not covered, so we cannot really remove QualType as in many cases TypeLoc.isNull() is true.

Yeah, that's why I was thinking this was too heavy of a lift. So this LGTM!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111199



More information about the cfe-commits mailing list