ABataev added inline comments.
================ Comment at: clang/lib/Sema/SemaOpenMP.cpp:38 #include "llvm/Frontend/OpenMP/OMPConstants.h" +#include "llvm/Support/ErrorHandling.h" #include <set> ---------------- Why do you need this here? ================ Comment at: clang/lib/Sema/SemaOpenMP.cpp:2016-2023 + if (DSAStack->getDefaultDSA() == DSA_firstprivate && + VarsWithInheritedDSAType().count(D) == 0 && + !DSAStack->hasExplicitDSA( + D, [](OpenMPClauseKind K) -> bool { return K == OMPC_firstprivate; }, + Level, /*NotLastprivate=*/true) && + Ty.getNonReferenceType()->isScalarType()) { + IsByRef = false; ---------------- atmnpatel wrote: > @ABataev Is this what you mean? Did you try to compile it? What is `VarsWithInheritedDSAType`, where is it declared and defined? You just need to check for something like this: ``` DSAStack->getDefaultDSA() == DSA_firstprivate && Ty->isScalarType() && !DSAStack->hasExplicitDSA(D, [](OpenMPClauseKind K) {return K != OMPC_unknown;} && !DSAStack->isLoopControlVariable(D, Level).first ``` i.e. the default DSA is firstprivate, the type is scalar, no explicit DSA for this variable and the variable is not a loop control variable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75591/new/ https://reviews.llvm.org/D75591 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits