[PATCH] D56760: Add a new builtin: __builtin_dynamic_object_size

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 23 12:30:54 PST 2019


erik.pilkington added a comment.

In D56760#1368216 <https://reviews.llvm.org/D56760#1368216>, @rsmith wrote:

> I don't see any evidence of that. Jakub said that modes 0-3 should stay static, but that's in line with what we suggested.


I don't think Jakub really said anything about whether we should go with a new builtin or use the flag bit. I'm basing this on Jonathan Wakely's comment:

> I know Jakub is concerned about arbitrarily complex expressions, when
>  **__builtin_object_size is supposed to always be efficient and always
>  evaluate at compile time (which would imply the dynamic behaviour
>  should be a separate builtin, if it exists at all)**.

So your call. FWIW I'd prefer the __builtin_object_size spelling too, but it doesn't seem like the GCC folks are super crazy about it to me. So it seems likely to me that if we implement it it will just be a clang extension for at least the medium term (if not permanently). I guess that's fine, so long as the GCC people are aware that it would be bad to extend their builtin to use `type&4`.


Repository:
  rC Clang

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

https://reviews.llvm.org/D56760





More information about the cfe-commits mailing list