[PATCH] D122822: [Clang][CodeGen]Add constant array support for __builtin_dump_sturct

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 12:39:15 PDT 2022


rsmith added a comment.

One thing we could do would be to build a descriptor for the type (as data) -- a type name string, a type "kind", plus (for a record type) a list of (field type descriptor, field name, offset) tuples -- and pass it to a user-specified function. We could provide a library implementation of a dumping function that takes that descriptor and a function with printf's signature and provides the "normal" formatting per the current `__builtin_dump_struct` behavior -- and indeed we could then implement `__builtin_dump_struct(p, f)` as a call to `normal_dumping_function(__builtin_type_descriptor(T), p, f)`. I'm not sure how comfortable we'd be putting that library implementation in compiler-rt versus somewhere else, though it presumably wouldn't be very large.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122822



More information about the cfe-commits mailing list