[PATCH] D20112: [OpenMP] Add support for the 'private pointer' flag to signal variables captured in target regions and used in first-private clauses.

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 20:13:26 PDT 2016


ABataev added inline comments.

================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:5630-5639
@@ -5599,6 +5629,12 @@
           // type, the default is 'tofrom'.
           CurMapTypes.push_back(ElementType->isAggregateType()
                                     ? (MappableExprsHandler::OMP_MAP_TO |
                                        MappableExprsHandler::OMP_MAP_FROM)
                                     : MappableExprsHandler::OMP_MAP_TO);
+
+          // If we have a capture by reference we may need to add the private
+          // pointer flag if the base declaration shows in some first-private
+          // clause.
+          CurMapTypes.back() = MCHandler.adjustMapModifiersForPrivateClauses(
+              CI, CurMapTypes.back());
         }
----------------
Maybe it is better to join all this code into a single function?


http://reviews.llvm.org/D20112





More information about the cfe-commits mailing list