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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 11:59:09 PDT 2022


rjmccall added a comment.

In D122822#3420162 <https://reviews.llvm.org/D122822#3420162>, @rsmith wrote:

> I'm concerned about the direction of this patch given @rjmccall's comments on https://reviews.llvm.org/D112626 -- presumably the way we'd want to address those comments would be to convert a `__builtin_dump_struct(a, f)` call into a single `f("...",  a.x, a.y, a.z)` call in Sema,  and that approach doesn't seem compatible with generating code to loop over array elements.

Well, we could generate a whole helper function that takes the struct by reference.  That would also drastically improve the code-size impact of this builtin, since it's likely that the builtin will be used multiple times with the same struct.

> I'm also concerned that this builtin is making a lot of design decisions on behalf of the programmer, meaning that either it does exactly what you want or it's not suitable for your use and there's not much you can do about it.

Yeah, I agree with this point, too; it's a very opinionated builtin.


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