[PATCH] D17578: [OpenCL]Allowing explicit conversion of "0" to event_t type

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 26 12:34:26 PST 2016


majnemer added a subscriber: majnemer.

================
Comment at: lib/Sema/SemaCast.cpp:2318
@@ +2317,3 @@
+    if (Self.getLangOpts().OpenCL && DestType->isEventT()) {
+      llvm::APSInt intValue;
+      if (SrcExpr.get()->EvaluateAsInt(intValue, Self.Context)) {
----------------
Please name this variable properly: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

================
Comment at: lib/Sema/SemaCast.cpp:2322-2323
@@ +2321,4 @@
+          Kind = CK_ZeroToOCLEvent;
+          return;
+        } else {
+          Self.Diag(OpRange.getBegin(),
----------------
Don't have an else after return.  http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return


http://reviews.llvm.org/D17578





More information about the cfe-commits mailing list