This is an archive of the discontinued LLVM Phabricator instance.

Make __builtin_object_size use the EM_IgnoreSideEffects evaluation mode.
ClosedPublic

Authored by jyknight on Oct 4 2018, 10:37 PM.

Details

Summary

And, since EM_OffsetFold is now unused, remove it.

While builtin_object_size intends to ignore the presence of
side-effects in its argument, the EM_OffsetFold mode was NOT
configured to ignore side-effects. Rather it was effectively identical
to EM_ConstantFold -- its explanatory comment
notwithstanding.

However, currently, keepEvaluatingAfterSideEffect() is not always
honored -- sometimes evaluation continues despite it returning
false. Therefore, since the b_o_s code was only checking the return
value from evaluation, and not additionally checking the
HasSideEffects flag, side-effects _were_ in many cases actually being
ignored.

This change is a prerequisite cleanup towards fixing that issue.

Diff Detail

Repository
rC Clang

Event Timeline

jyknight created this revision.Oct 4 2018, 10:37 PM
rsmith accepted this revision.Oct 9 2018, 12:20 PM

Thanks, looks like this has been largely redundant since r294800 removed the only interesting thing that EM_OffsetFold did.

This revision is now accepted and ready to land.Oct 9 2018, 12:20 PM
This revision was automatically updated to reflect the committed changes.