[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 16:47:30 PST 2024


efriedma-quic wrote:

> maybe we could add the subtype as part of the llvm.objectsize intrinsic and use that instead of grappling with the whole object's type

I'm not sure I follow; if you know the object's type, doesn't that mean you also know its size?

>(I don't readily know of any transformation that changes a structure's layout. Does it exist?)

Any such transform has to reason about all the uses, so the llvm.objectsize call itself would prevent the transform from happening.

https://github.com/llvm/llvm-project/pull/78526


More information about the cfe-commits mailing list