[PATCH] D77731: [OPENMP]Fix capturing of global variables in OpenMP regions.
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 17:56:53 PDT 2020
ABataev marked an inline comment as done.
ABataev added inline comments.
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2117
+ if (VD && !VD->hasLocalStorage() && DVarPrivate.CKind == OMPC_unknown &&
+ (DSAStack->getDefaultDSA() != DSA_none || DVarTop.CKind == OMPC_shared))
+ return nullptr;
----------------
jdoerfert wrote:
> ABataev wrote:
> > jdoerfert wrote:
> > > Does `DSAStack->getDefaultDSA() != DSA_none` work once we have `(first)private` default kinds or do we need to check for shared explicitly?
> > An extra check for `!= DSA_firstprivate` will be required.
> OK. Needs to be part of D75591. @atmnpatel Can you include this in your patch?
Most probably, even this won't be necessary. Either `getTopDSA` will rerurn `OMPC_firstprivate`, or the `if` statement after this one will return false and control fallback to the default `return nullptr;`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77731/new/
https://reviews.llvm.org/D77731
More information about the cfe-commits
mailing list