[PATCH] [PATCH] OpenMP firstprivate clause

Dmitri Gribenko gribozavr at gmail.com
Mon Sep 16 23:45:38 PDT 2013


  Does template instantiation work?  Any tests for it if it does?


================
Comment at: include/clang/AST/StmtOpenMP.h:338-340
@@ -276,5 +337,5 @@
   ///
   explicit OMPSharedClause(unsigned N)
-    : OMPClause(OMPC_private, SourceLocation(), SourceLocation()),
+    : OMPClause(OMPC_shared, SourceLocation(), SourceLocation()),
       OMPVarList<OMPSharedClause>(SourceLocation(), N) { }
 public:
----------------
This bugfix is quite obvious and can be committed separately.

================
Comment at: lib/AST/StmtPrinter.cpp:602-607
@@ -601,8 +601,8 @@
 
 #define PROCESS_OMP_CLAUSE_LIST(Class, Node, StartSym)                         \
-  for (OMPVarList<Class>::varlist_iterator I = Node->varlist_begin(),          \
-                                           E = Node->varlist_end();            \
+  for (Class::varlist_iterator I = Node->varlist_begin(),                      \
+                               E = Node->varlist_end();                        \
          I != E; ++I)                                                          \
     OS << (I == Node->varlist_begin() ? StartSym : ',')                        \
        << *cast<NamedDecl>(cast<DeclRefExpr>(*I)->getDecl());
 
----------------
Why this macro can't be a static helper function?  (Or a function template if it needs to be?)

Same for other similar macros.

================
Comment at: lib/Sema/SemaOpenMP.cpp:903
@@ +902,3 @@
+       I != E; ++I) {
+    if (*I && isa<DependentScopeDeclRefExpr>(*I)) {
+      // It will be analyzed later.
----------------
Why "*I" null check here?  *I is unconditionally dereferenced below anyway. 


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



More information about the cfe-commits mailing list