[PATCH] [OPENMP] Parsing and sema support for #pragma omp target data" directive.

Kelvin Li kkwli0 at gmail.com
Wed Jul 1 08:03:49 PDT 2015


================
Comment at: lib/Parse/ParseOpenMP.cpp:43-55
@@ -42,2 +42,15 @@
           : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok));
+
+  switch (DKind) {
+  case OMPD_target: {
+    auto SavedToken = P.getPreprocessor().LookAhead(0);
+    if (!SavedToken.isAnnotation()) {
+      if (P.getPreprocessor().getSpelling(SavedToken) == "data") {
+        DKind = OMPD_target_data;
+        P.ConsumeToken();
+      }
+    }
+    break;
+  }
+  default:
   for (unsigned i = 0; i < llvm::array_lengthof(F); ++i) {
----------------
ABataev wrote:
> This code is copied from clang-omp, we're using another solution in official clang. See the patch for 'declare simd' construct (http://reviews.llvm.org/D10599)
Perhaps I misunderstand it.  The issue of the suggested approach is that it treats 'data' as a directive in order to have { OMPD_target, OMPD_data, OMPD_target_data }.  Creating a fake OMPD_data may be confusing.  That is why I took this approach.

http://reviews.llvm.org/D10765

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list