summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-06-15 11:20:48 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-06-15 11:20:48 +0000
commitb46cdeae9f5e94b12ca321e91ddef0974440222e (patch)
tree62b128b0c81b10883ad0382acaef3f687f68aff5 /clang/lib/Sema/SemaOpenMP.cpp
parent86e786bd17603b3839a8654ddae7710a63f8008d (diff)
downloadbcm5719-llvm-b46cdeae9f5e94b12ca321e91ddef0974440222e.tar.gz
bcm5719-llvm-b46cdeae9f5e94b12ca321e91ddef0974440222e.zip
[OPENMP] Fix crash for 'schedule|dist_schedule' clauses during
instantiation. Added checks for non-dependent context when trygin to capture non-constant schedule chunk expression for proper codegen of outlined functions. llvm-svn: 272775
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 36ad9e80e37..291b9fa0189 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -7341,7 +7341,8 @@ OMPClause *Sema::ActOnOpenMPScheduleClause(
<< "schedule" << 1 << ChunkSize->getSourceRange();
return nullptr;
}
- } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective())) {
+ } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective()) &&
+ !CurContext->isDependentContext()) {
llvm::MapVector<Expr *, DeclRefExpr *> Captures;
ValExpr = tryBuildCapture(*this, ValExpr, Captures).get();
HelperValStmt = buildPreInits(Context, Captures);
@@ -10877,7 +10878,8 @@ OMPClause *Sema::ActOnOpenMPDistScheduleClause(
<< "dist_schedule" << ChunkSize->getSourceRange();
return nullptr;
}
- } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective())) {
+ } else if (isParallelOrTaskRegion(DSAStack->getCurrentDirective()) &&
+ !CurContext->isDependentContext()) {
llvm::MapVector<Expr *, DeclRefExpr *> Captures;
ValExpr = tryBuildCapture(*this, ValExpr, Captures).get();
HelperValStmt = buildPreInits(Context, Captures);
OpenPOWER on IntegriCloud