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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits