ABataev added inline comments. ================ Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:53-57 @@ -52,2 +52,7 @@ auto &&CodeGen = [&D](CodeGenFunction &CGF) { + CodeGenFunction::OMPPrivateScope PrivateScope(CGF); + (void)CGF.EmitOMPFirstprivateClause(D, PrivateScope); + CGF.EmitOMPPrivateClause(D, PrivateScope); + (void)PrivateScope.Privatize(); + CGF.EmitStmt(cast<CapturedStmt>(D.getAssociatedStmt())->getCapturedStmt()); ---------------- After some investigation I found out that this the same code, that a;ready exists in CodeGenFunction::EmitOMPTeamsDirective(). I think you must remove emitTeamsCall() from CGOpenMPRuntimeNVPTX class and modify CodeGenFunction::EmitOMPTeamsDirective() like this: ``` void CodeGenFunction::EmitOMPTeamsDirective(const OMPTeamsDirective &S) { OMPLexicalScope(*this, S); // Emit parallel region as a standalone region. auto &&CodeGen = [&S](CodeGenFunction &CGF) { OMPPrivateScope PrivateScope(CGF); (void)CGF.EmitOMPFirstprivateClause(S, PrivateScope); CGF.EmitOMPPrivateClause(S, PrivateScope); (void)PrivateScope.Privatize(); CGF.EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); }; if (getLangOpts().OpenMPIsDevice) emitInlinedDirective(CGF, OMPD_teams, CodeGen); else emitCommonOMPTeamsDirective(*this, S, OMPD_teams, CodeGen); } ```
Repository: rL LLVM http://reviews.llvm.org/D18286 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits