diff options
| author | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2017-01-18 15:36:05 +0000 |
|---|---|---|
| committer | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2017-01-18 15:36:05 +0000 |
| commit | 42793e000a4a9b6b337b3d168e2543c533835084 (patch) | |
| tree | b8cc7a9c9861b5e33517104f7084b0674d1ab054 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
| parent | 8277c41a899bc2e1290ce22595fbd79191f32066 (diff) | |
| download | bcm5719-llvm-42793e000a4a9b6b337b3d168e2543c533835084.tar.gz bcm5719-llvm-42793e000a4a9b6b337b3d168e2543c533835084.zip | |
Revert r292374 to debug Windows buildbot failure.
llvm-svn: 292400
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index ba531b96ccf..2d14ec40cbb 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1213,9 +1213,10 @@ static void emitCommonOMPParallelDirective(CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) { - const CapturedStmt *CS = S.getCapturedStmt(OMPD_parallel); - auto OutlinedFn = CGF.CGM.getOpenMPRuntime().emitParallelOutlinedFunction( - S, *CS->getCapturedDecl()->param_begin(), InnermostKind, CodeGen); + auto CS = cast<CapturedStmt>(S.getAssociatedStmt()); + auto OutlinedFn = CGF.CGM.getOpenMPRuntime(). + emitParallelOrTeamsOutlinedFunction(S, + *CS->getCapturedDecl()->param_begin(), InnermostKind, CodeGen); if (const auto *NumThreadsClause = S.getSingleClause<OMPNumThreadsClause>()) { CodeGenFunction::RunCleanupsScope NumThreadsScope(CGF); auto NumThreads = CGF.EmitScalarExpr(NumThreadsClause->getNumThreads(), @@ -3496,9 +3497,10 @@ static void emitCommonOMPTeamsDirective(CodeGenFunction &CGF, const OMPExecutableDirective &S, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) { - const CapturedStmt *CS = S.getCapturedStmt(OMPD_teams); - auto OutlinedFn = CGF.CGM.getOpenMPRuntime().emitTeamsOutlinedFunction( - S, *CS->getCapturedDecl()->param_begin(), InnermostKind, CodeGen); + auto CS = cast<CapturedStmt>(S.getAssociatedStmt()); + auto OutlinedFn = CGF.CGM.getOpenMPRuntime(). + emitParallelOrTeamsOutlinedFunction(S, + *CS->getCapturedDecl()->param_begin(), InnermostKind, CodeGen); const OMPTeamsDirective &TD = *dyn_cast<OMPTeamsDirective>(&S); const OMPNumTeamsClause *NT = TD.getSingleClause<OMPNumTeamsClause>(); @@ -3753,39 +3755,9 @@ void CodeGenFunction::EmitOMPTargetExitDataDirective( CGM.getOpenMPRuntime().emitTargetDataStandAloneCall(*this, S, IfCond, Device); } -static void emitTargetParallelRegion(CodeGenFunction &CGF, - const OMPTargetParallelDirective &S, - PrePostActionTy &Action) { - // Get the captured statement associated with the 'parallel' region. - auto *CS = S.getCapturedStmt(OMPD_parallel); - Action.Enter(CGF); - auto &&CodeGen = [CS](CodeGenFunction &CGF, PrePostActionTy &) { - // TODO: Add support for clauses. - CGF.EmitStmt(CS->getCapturedStmt()); - }; - emitCommonOMPParallelDirective(CGF, S, OMPD_parallel, CodeGen); -} - -void CodeGenFunction::EmitOMPTargetParallelDeviceFunction( - CodeGenModule &CGM, StringRef ParentName, - const OMPTargetParallelDirective &S) { - auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) { - emitTargetParallelRegion(CGF, S, Action); - }; - llvm::Function *Fn; - llvm::Constant *Addr; - // Emit target region as a standalone region. - CGM.getOpenMPRuntime().emitTargetOutlinedFunction( - S, ParentName, Fn, Addr, /*IsOffloadEntry=*/true, CodeGen); - assert(Fn && Addr && "Target device function emission failed."); -} - void CodeGenFunction::EmitOMPTargetParallelDirective( const OMPTargetParallelDirective &S) { - auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) { - emitTargetParallelRegion(CGF, S, Action); - }; - emitCommonOMPTargetDirective(*this, S, CodeGen); + // TODO: codegen for target parallel. } void CodeGenFunction::EmitOMPTargetParallelForDirective( |

