ExprConstant: Make __builtin_object_size use EM_IgnoreSideEffects.
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. Differential Revision: https://reviews.llvm.org/D52924 llvm-svn: 344110
Loading
Please register or sign in to comment