[PATCH] [OPENMP] Codegen for threadprivate variables

Alexey Bataev a.bataev at hotmail.com
Tue Sep 23 03:47:21 PDT 2014


Ping

================
Comment at: lib/CodeGen/CGDeclCXX.cpp:547
@@ +546,3 @@
+
+void CodeGenModule::EmitCXXOMPThreadPrivateInitFunction(const VarDecl &VD,
+                                                        llvm::Constant *Addr,
----------------
hfinkel wrote:
> Like John said for EmitOMPSerialCall, this seems like it belongs in CGOpenMPRuntime.cpp.
I'll rework this to remove direct calls to runtime functions.

================
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
----------------
hfinkel wrote:
> Why not use the SourceLocation of the variable's initializer?
Will be fixed.

================
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:
----------------
hfinkel wrote:
> Is this a separate change?
Nope, this is required for codegen, without it the declaration is not passed to codegen consumer.

================
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;
----------------
hfinkel wrote:
> This is a separate change.
Nope, it's a part of codegen, without this change codegen for construct loaded from .pch does not work.

http://reviews.llvm.org/D4002






More information about the cfe-commits mailing list