[PATCH] D52654: [OpenCL][NFC] Unify ZeroToOCL* cast types

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 10:14:29 PDT 2018


Anastasia added inline comments.


================
Comment at: lib/Sema/SemaInit.cpp:5286
 
-static bool TryOCLZeroQueueInitialization(Sema &S,
-                                          InitializationSequence &Sequence,
-                                          QualType DestType,
-                                          Expr *Initializer) {
-  if (!S.getLangOpts().OpenCL || S.getLangOpts().OpenCLVersion < 200 ||
-      !DestType->isQueueT() ||
-      !Initializer->isIntegerConstantExpr(S.getASTContext()) ||
-      (Initializer->EvaluateKnownConstInt(S.getASTContext()) != 0))
-    return false;
+  if (DestType->isQueueT() && S.getLangOpts().OpenCLVersion >= 200) {
+    if (!Initializer->isIntegerConstantExpr(S.getASTContext()) ||
----------------
Let's remove OpenCLVersion check here because we reject queue_t during parsing if cl-std!=CL2.0.


================
Comment at: lib/Sema/SemaInit.cpp:5291
 
-  Sequence.AddOCLZeroQueueStep(DestType);
-  return true;
+    Sequence.AddOCLZeroQueueStep(DestType);
+    return true;
----------------
I guess this one can't be generalized?


Repository:
  rC Clang

https://reviews.llvm.org/D52654





More information about the cfe-commits mailing list