summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-03-28 12:58:34 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-03-28 12:58:34 +0000
commitf539faa7333e7c807eaca00c586cf6aa15bf333c (patch)
treeb1ce4a198ca575ffe26a3f7ad0fe60ab27ff013c /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
parent424be9283188be74ef68f017858a383833ec46c1 (diff)
downloadbcm5719-llvm-f539faa7333e7c807eaca00c586cf6aa15bf333c.tar.gz
bcm5719-llvm-f539faa7333e7c807eaca00c586cf6aa15bf333c.zip
Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
Reverting because of failed tests. llvm-svn: 264577
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
index 3b2b30cdb73..3a634ac3087 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
@@ -305,32 +305,28 @@ void CGOpenMPRuntimeNVPTX::createOffloadEntry(llvm::Constant *ID,
void CGOpenMPRuntimeNVPTX::emitTargetOutlinedFunction(
const OMPExecutableDirective &D, StringRef ParentName,
llvm::Function *&OutlinedFn, llvm::Constant *&OutlinedFnID,
- bool IsOffloadEntry, const RegionCodeGenTy &CodeGen) {
+ bool IsOffloadEntry) {
if (!IsOffloadEntry) // Nothing to do.
return;
assert(!ParentName.empty() && "Invalid target region parent name!");
+ const CapturedStmt &CS = *cast<CapturedStmt>(D.getAssociatedStmt());
+
EntryFunctionState EST;
WorkerFunctionState WST(CGM);
// Emit target region as a standalone region.
- class NVPTXPrePostActionTy : public PrePostActionTy {
- CGOpenMPRuntimeNVPTX &RT;
- CGOpenMPRuntimeNVPTX::EntryFunctionState &EST;
- CGOpenMPRuntimeNVPTX::WorkerFunctionState &WST;
-
- public:
- NVPTXPrePostActionTy(CGOpenMPRuntimeNVPTX &RT,
- CGOpenMPRuntimeNVPTX::EntryFunctionState &EST,
- CGOpenMPRuntimeNVPTX::WorkerFunctionState &WST)
- : RT(RT), EST(EST), WST(WST) {}
- void Enter(CodeGenFunction &CGF) override {
- RT.emitEntryHeader(CGF, EST, WST);
- }
- void Exit(CodeGenFunction &CGF) override { RT.emitEntryFooter(CGF, EST); }
- } Action(*this, EST, WST);
- CodeGen.setAction(Action);
+ auto &&CodeGen = [&EST, &WST, &CS, &D, this](CodeGenFunction &CGF) {
+ CodeGenFunction::OMPPrivateScope PrivateScope(CGF);
+ (void)CGF.EmitOMPFirstprivateClause(D, PrivateScope);
+ CGF.EmitOMPPrivateClause(D, PrivateScope);
+ (void)PrivateScope.Privatize();
+
+ emitEntryHeader(CGF, EST, WST);
+ CGF.EmitStmt(CS.getCapturedStmt());
+ emitEntryFooter(CGF, EST);
+ };
emitTargetOutlinedFunctionHelper(D, ParentName, OutlinedFn, OutlinedFnID,
IsOffloadEntry, CodeGen);
OpenPOWER on IntegriCloud