[PATCH] D75591: [OpenMP] Add firstprivate as a default data-sharing attribute to clang

Atmn Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 16:16:51 PDT 2020


atmnpatel added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:3211-3213
+          VD->getStorageClass() == SC_Static &&
+          (CanonicalVD->getDeclContext()->isNamespace() ||
+           !VD->isLocalVarDeclOrParm())) {
----------------
ABataev wrote:
> atmnpatel wrote:
> > ABataev wrote:
> > > atmnpatel wrote:
> > > > ABataev wrote:
> > > > > I think just `!VD->hasLocalStorage()` should be enough here. Shall it work for static locals too or just for globals?
> > > > Just for globals.
> > > What about static data members?
> > The TR doesn't specify that static data members should inherit DSAs / have them explicitly defined.
> What about non-static globals? Your current check works only for something like `static int var;`, but not `int var;`.
Sorry, I wasn't really clear with my earlier comment, I meant that just static global variables and static namespace variables need to have their DSA inherited/explicitly defined. So a global variable would become firstprivate implicitly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75591/new/

https://reviews.llvm.org/D75591





More information about the llvm-commits mailing list