@@ -6410,9 +6410,9 @@ static bool TryOCLSamplerInitialization(Sema &S,
6410
6410
return true ;
6411
6411
}
6412
6412
6413
- static bool IsZeroInitializer (Expr *Initializer, Sema &S ) {
6414
- return Initializer-> isIntegerConstantExpr (S. getASTContext ()) &&
6415
- (Initializer-> EvaluateKnownConstInt (S. getASTContext ()) == 0 );
6413
+ static bool IsZeroInitializer (const Expr *Init, ASTContext &Ctx ) {
6414
+ std::optional<llvm::APSInt> Value = Init-> getIntegerConstantExpr (Ctx);
6415
+ return Value && Value-> isZero ( );
6416
6416
}
6417
6417
6418
6418
static bool TryOCLZeroOpaqueTypeInitialization (Sema &S,
@@ -6431,7 +6431,7 @@ static bool TryOCLZeroOpaqueTypeInitialization(Sema &S,
6431
6431
// event should be zero.
6432
6432
//
6433
6433
if (DestType->isEventT () || DestType->isQueueT ()) {
6434
- if (!IsZeroInitializer (Initializer, S))
6434
+ if (!IsZeroInitializer (Initializer, S. getASTContext () ))
6435
6435
return false ;
6436
6436
6437
6437
Sequence.AddOCLZeroOpaqueTypeStep (DestType);
@@ -6447,7 +6447,7 @@ static bool TryOCLZeroOpaqueTypeInitialization(Sema &S,
6447
6447
if (DestType->isOCLIntelSubgroupAVCMcePayloadType () ||
6448
6448
DestType->isOCLIntelSubgroupAVCMceResultType ())
6449
6449
return false ;
6450
- if (!IsZeroInitializer (Initializer, S))
6450
+ if (!IsZeroInitializer (Initializer, S. getASTContext () ))
6451
6451
return false ;
6452
6452
6453
6453
Sequence.AddOCLZeroOpaqueTypeStep (DestType);
0 commit comments