This fix UBSAN bots after r302935. Storing non-defined values in enum is
undefined behavior.
Other places, where "if (ScalarCast != CK_Invalid)" is used, never get to the
"if" with CK_Invalid. tryGCCVectorConvertAndSplat can get to the "if" with
CK_Invalid and it looks like expected case. So we have to use something other
than CK_Invalid, e.g. CK_NoOp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303121
91177308-0d34-0410-b5e6-
96231b3b80d8
// The conversion to apply to the scalar before splatting it,
// if necessary.
- CastKind ScalarCast = CK_Invalid;
+ CastKind ScalarCast = CK_NoOp;
// Accept cases where the vector elements are integers and the scalar is
// an integer.
// Adjust scalar if desired.
if (Scalar) {
- if (ScalarCast != CK_Invalid)
+ if (ScalarCast != CK_NoOp)
*Scalar = S.ImpCastExprToType(Scalar->get(), VectorEltTy, ScalarCast);
*Scalar = S.ImpCastExprToType(Scalar->get(), VectorTy, CK_VectorSplat);
}