This is an archive of the discontinued LLVM Phabricator instance.

Add a parameter to the objectsize intrinsic that controls whether to evaluate size dynamically
ClosedPublic

Authored by erik.pilkington on Jan 15 2019, 4:52 PM.

Details

Summary

This will be used by a new clang builtin __builtin_dynamic_object_size. This builtin is meant to be used as drop-in replacement for __builtin_object_size. When BDOS can't be folded statically, then it computes the object size at runtime. You can see the clang patch here: https://reviews.llvm.org/D56760

rdar://problem/32212419 ER: evaluate builtin_objectsize (or a successor) at runtime, at least when alloc_size is available

Thanks for taking a look!
Erik

Diff Detail

Repository
rL LLVM

Event Timeline

jfb added a subscriber: jfb.Jan 18 2019, 10:42 AM
jfb accepted this revision.Jan 29 2019, 1:26 PM

This seems fine regardless of the route we take for D56760 (assuming we commit *something*).

This revision is now accepted and ready to land.Jan 29 2019, 1:26 PM
This revision was automatically updated to reflect the committed changes.
vsk added a subscriber: vsk.Feb 8 2019, 1:19 PM

I think this breaks bitcode backwards compatibility:

Callsite was not defined with variable arguments!
i64 (i8*, i1, i1)* @llvm.objectsize.i64.p0i8
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2019, 1:19 PM
erik.pilkington marked an inline comment as done.
In D56761#1391118, @vsk wrote:

I think this breaks bitcode backwards compatibility:

Callsite was not defined with variable arguments!
i64 (i8*, i1, i1)* @llvm.objectsize.i64.p0i8

Thanks for letting me know, should be fixed by D58071.