[PATCH] D74668: [Clang][BPF] implement __builtin_btf_type_id() builtin function

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 18 14:06:18 PDT 2020


dblaikie added a comment.

(mentioned also on the LLVM side of this D74572 <https://reviews.llvm.org/D74572>)

If this is in the interests of retaining certain types in the emitted debug info - it seems quite complicated compared to what I'd hope for. Would it be sufficient to support __attribute__((used)) on a type and have that force the type to be emitted into DWARF (this could be implemented using DICompileUNit's "retainedTypes" list (& is similar to what LLVM does for references to enum constants where the enum isn't otherwise used as a type in a function signature, variable, etc - attaching them to the DICompileUnit's "enums" list)). That seems like a more general purpose and tidier way that adding/removing things, having extra transformation passes, etc. (& even if __attribute__((used)) isn't suitable for your needs - at least, hopefully, you could still use DICompileUnit's retainedTypes list to save your types detected through some other means, and not need the backend pass to strip out these extra intrinsic calls, etc)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74668





More information about the cfe-commits mailing list