[PATCH] D15944: [OpenMP] Parsing and sema support for target update directive

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 05:32:58 PST 2016


ABataev added a comment.

Kelvin, thanks for the patch!
One more comment: what about nesting of regions? You need to add a corresponding code and tests


================
Comment at: include/clang/AST/OpenMPClause.h:3196
@@ -3195,1 +3195,3 @@
 
+/// \brief This represents clause 'from' in the '#pragma omp ...'
+/// directives.
----------------
New clauses must be added in separate patches after commit of the new directive.

================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:2685
@@ +2684,3 @@
+    const OMPTargetUpdateDirective &S) {
+  llvm_unreachable("CodeGen for 'omp target update' is not supported yet.");
+}
----------------
Maybe just do not emit anything, to not crash a compiler.

================
Comment at: lib/Parse/ParseOpenMP.cpp:71-74
@@ -69,3 +70,6 @@
              !P.getPreprocessor().getSpelling(Tok).compare("point")) ||
-            ((i == 1) && !P.getPreprocessor().getSpelling(Tok).compare("data"));
+            ((i == 1) &&
+             !P.getPreprocessor().getSpelling(Tok).compare("data")) ||
+            ((i == 2) &&
+             !P.getPreprocessor().getSpelling(Tok).compare("update"));
       } else {
----------------
Probably, we need to add local enumeric for these constants (0, 1, 2 etc.) 


http://reviews.llvm.org/D15944





More information about the cfe-commits mailing list