[PATCH] D46667: [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 10 05:35:43 PDT 2018


ABataev added inline comments.


================
Comment at: lib/Sema/SemaDecl.cpp:11348
     // initialiser
-    if (var->getTypeSourceInfo()->getType()->isBlockPointerType() &&
-        !var->hasInit()) {
+    if (var->getType()->isBlockPointerType() && !var->hasInit()) {
       Diag(var->getLocation(), diag::err_opencl_invalid_block_declaration)
----------------
Anastasia wrote:
> Does `simd` result in block creation? My original understanding of it was that it will result in vector operations, not extra threads. 
Currently all of the OpenMP constructs (even simd) create special lambda-like construct CapturedStmt that are kind of a block. It is required for unified processing of the OpenMP constructs. 


================
Comment at: test/SemaOpenCL/omp_simd.cl:1
+// RUN: %clang_cc1 -verify -fopenmp -fsyntax-only -x cl %s
+// expected-no-diagnostics
----------------
It would be good to check that at least -ast-print or -ast-dump works correctly. 


Repository:
  rC Clang

https://reviews.llvm.org/D46667





More information about the cfe-commits mailing list