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

Atmn Patel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 14 19:53:51 PDT 2020


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);
----------------
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.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75591





More information about the cfe-commits mailing list