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

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 23:19:16 PDT 2021


yonghong-song added a comment.

> 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.


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