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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 21:54:58 PDT 2020


jdoerfert added a comment.

I'm satisfied with this, @fghanim wdyt?



================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:5102
       Diag(P.second->getExprLoc(), diag::err_omp_no_dsa_for_variable)
           << P.first << P.second->getSourceRange();
       Diag(DSAStack->getDefaultDSALocation(), diag::note_omp_default_dsa_none);
----------------
atmnpatel wrote:
> fghanim wrote:
> > Why is `firstprivate` throwing this error? isn't the purpose of specifying it as `default` is if a variable is not specified as anything, then it is automatically handled as `firstprivate`? or am I misunderstanding something?
> My understanding is that if that line isn't there then errors won't be thrown in the special cases where firstprivate explicitly requires a data sharing attribute to be specified - such as for static variable within a namespace/global scope as per the C/C++ restrictions in the technical report.
Do we have a test for that or can we add one, please. (If you remove this and an error we expect in the existing tests is not shown anymore that is sufficient.)


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