[PATCH] [OPENMP] Codegen for threadprivate variables

hfinkel at anl.gov hfinkel at anl.gov
Mon Sep 22 02:13:47 PDT 2014


================
Comment at: lib/CodeGen/CGDeclCXX.cpp:547
@@ +546,3 @@
+
+void CodeGenModule::EmitCXXOMPThreadPrivateInitFunction(const VarDecl &VD,
+                                                        llvm::Constant *Addr,
----------------
Like John said for EmitOMPSerialCall, this seems like it belongs in CGOpenMPRuntime.cpp.

================
Comment at: lib/CodeGen/CGDeclCXX.cpp:620
@@ +619,3 @@
+                        getTypes().arrangeNullaryFunction(), ArgList,
+                        SourceLocation());
+  // Call kmp_int32 __kmpc_global_thread_num(&loc) to init OpenMP runtime
----------------
Why not use the SourceLocation of the variable's initializer?

================
Comment at: lib/Parse/Parser.cpp:627
@@ -626,4 +626,3 @@
   case tok::annot_pragma_openmp:
-    ParseOpenMPDeclarativeDirective();
-    return DeclGroupPtrTy();
+    return ParseOpenMPDeclarativeDirective();
   case tok::annot_pragma_ms_pointers_to_members:
----------------
Is this a separate change?

================
Comment at: lib/Serialization/ASTReaderDecl.cpp:2186
@@ -2185,3 +2185,3 @@
       isa<ObjCImplDecl>(D) ||
-      isa<ImportDecl>(D))
+      isa<ImportDecl>(D) || isa<OMPThreadPrivateDecl>(D))
     return true;
----------------
This is a separate change.

http://reviews.llvm.org/D4002






More information about the cfe-commits mailing list