[PATCH] OpenMP parallel directive

Wei Pan wei.pan at intel.com
Fri Jun 21 06:19:53 PDT 2013



================
Comment at: include/clang/AST/StmtOpenMP.h:18
@@ +17,3 @@
+
+#include "clang/Basic/SourceLocation.h"
+#include "clang/Basic/OpenMPKinds.h"
----------------
sort headers

================
Comment at: include/clang/AST/StmtOpenMP.h:138
@@ +137,3 @@
+  OpenMPDefaultClauseKind Kind;
+  /// \brief Start location of the kind in cource code.
+  SourceLocation KindKwLoc;
----------------
source

================
Comment at: lib/Parse/ParseOpenMP.cpp:337
@@ +336,3 @@
+  bool IsComma = true;
+  while (IsComma || (Tok.isNot(tok::r_paren) &&
+                     Tok.isNot(tok::annot_pragma_openmp_end))) {
----------------
This seems to accept

#pragma omp parallel private(x    y)

Tests for this?


================
Comment at: lib/Sema/SemaOpenMP.cpp:19
@@ -17,1 +18,3 @@
 #include "clang/AST/DeclOpenMP.h"
+#include "clang/AST/StmtOpenMP.h"
+#include "clang/AST/StmtCXX.h"
----------------
need to sort

================
Comment at: lib/Sema/SemaOpenMP.cpp:406
@@ +405,3 @@
+
+    // OpenMP [2.9.3.3, Restrictions, C/C++, p.1]
+    //  A variable of class type (or array thereof) that appears in a private
----------------
This is missing.

A variable that appears in a private clause must not have a const-qualified type
unless it is of class type with a mutable member.



================
Comment at: include/clang/Sema/Sema.h:33
@@ -31,2 +32,3 @@
 #include "clang/Basic/TypeTraits.h"
+#include "clang/Basic/OpenMPKinds.h"
 #include "clang/Lex/ModuleLoader.h"
----------------
sort includes

================
Comment at: include/clang/AST/StmtOpenMP.h:57
@@ +56,3 @@
+
+  bool isImplicit() { return StartLoc.isInvalid();}
+
----------------
add const?


http://llvm-reviews.chandlerc.com/D572



More information about the cfe-commits mailing list