[PATCH] D21904: [OpenMP] Initial implementation of parse+sema for clause use_device_ptr of 'target data'

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 11 03:16:57 PDT 2016

ABataev added a comment.

No positive tests for the construct

Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8333
@@ -8332,1 +8332,3 @@
   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
+def  err_omp_usedeviceptr_not_a_pointer : Error<
+  "expected pointer in 'use_device_ptr' clause">;
Shall we accept refs to pointers and arrays?

Comment at: lib/Sema/SemaOpenMP.cpp:11644-11646
@@ +11643,5 @@
+    Type = Type.getUnqualifiedType();
+    DeclRefExpr *Ref = nullptr;
+    if (!VD)
+      Ref = buildCapture(*this, D, SimpleRefExpr, /*WithInit=*/false);
+    Vars.push_back(VD ? RefExpr->IgnoreParens() : Ref);
It is better to add this code in codegen part



More information about the cfe-commits mailing list