summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-10-10 12:19:54 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-10-10 12:19:54 +0000
commit1809571c7698e133e6325a9d8911ee073e35dfe8 (patch)
tree62b8e1e99acb017f78bddbd96c359dfb09746c2d /clang/lib/CodeGen/CGStmtOpenMP.cpp
parent1a8093c3a7997879702b0a4fb4920add444c1392 (diff)
downloadbcm5719-llvm-1809571c7698e133e6325a9d8911ee073e35dfe8.tar.gz
bcm5719-llvm-1809571c7698e133e6325a9d8911ee073e35dfe8.zip
Code reformatting and improvement for OpenMP.
Moved CGOpenMPRegionInfo from CGOpenMPRuntime.h to CGOpenMPRuntime.cpp file and reworked the code for this change. Also added processing of ThreadID variable passed as an argument in outlined functions in parallel and task directives. llvm-svn: 219490
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 1b3e786b30b..2aec28f3051 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -138,17 +138,10 @@ void CodeGenFunction::EmitOMPFirstprivateClause(
}
void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
- const CapturedStmt *CS = cast<CapturedStmt>(S.getAssociatedStmt());
- llvm::Value *CapturedStruct = GenerateCapturedStmtArgument(*CS);
-
- llvm::Value *OutlinedFn;
- {
- CodeGenFunction CGF(CGM, true);
- CGOpenMPRegionInfo CGInfo(S, *CS, *CS->getCapturedDecl()->param_begin());
- CGF.CapturedStmtInfo = &CGInfo;
- OutlinedFn = CGF.GenerateCapturedStmtFunction(*CS);
- }
-
+ auto CS = cast<CapturedStmt>(S.getAssociatedStmt());
+ auto CapturedStruct = GenerateCapturedStmtArgument(*CS);
+ auto OutlinedFn = CGM.getOpenMPRuntime().EmitOpenMPOutlinedFunction(
+ S, *CS->getCapturedDecl()->param_begin());
CGM.getOpenMPRuntime().EmitOMPParallelCall(*this, S.getLocStart(), OutlinedFn,
CapturedStruct);
}
OpenPOWER on IntegriCloud