[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
Sat Mar 21 09:37:31 PDT 2020


atmnpatel marked 3 inline comments as done.
atmnpatel added inline comments.


================
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);
----------------
jdoerfert wrote:
> 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.)
There are tests with expected-errors from failing to explicitly declare the data-sharing attributes for those variables.


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