summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-09-03 10:21:46 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-09-03 10:21:46 +0000
commitb500101e1ce02ace5dc0aa1e63a40e28928e37c2 (patch)
tree67cb982ed2733a2f7aced8a4b34aecde2452405f /clang/lib/Sema/SemaExpr.cpp
parent5055685cda022119052d86cb468cf2b7f4d19a13 (diff)
downloadbcm5719-llvm-b500101e1ce02ace5dc0aa1e63a40e28928e37c2.tar.gz
bcm5719-llvm-b500101e1ce02ace5dc0aa1e63a40e28928e37c2.zip
[OPENMP] Fix for http://llvm.org/PR24687: ICE on compilation of R package TPmsm.
Fixed capturing of VLAs in 'private' clause of the OpenMP directives. llvm-svn: 246757
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 10b37557802..bfb98413a8a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -13000,21 +13000,6 @@ bool Sema::tryCaptureVariable(
if (isVariableAlreadyCapturedInScopeInfo(CSI, Var, Nested, CaptureType,
DeclRefType))
break;
- if (getLangOpts().OpenMP) {
- if (auto *RSI = dyn_cast<CapturedRegionScopeInfo>(CSI)) {
- // OpenMP private variables should not be captured in outer scope, so
- // just break here.
- if (RSI->CapRegionKind == CR_OpenMP) {
- if (isOpenMPPrivateVar(Var, OpenMPLevel)) {
- Nested = true;
- DeclRefType = DeclRefType.getUnqualifiedType();
- CaptureType = Context.getLValueReferenceType(DeclRefType);
- break;
- }
- ++OpenMPLevel;
- }
- }
- }
// If we are instantiating a generic lambda call operator body,
// we do not want to capture new variables. What was captured
// during either a lambdas transformation or initial parsing
@@ -13160,6 +13145,21 @@ bool Sema::tryCaptureVariable(
} while (!QTy.isNull() && QTy->isVariablyModifiedType());
}
+ if (getLangOpts().OpenMP) {
+ if (auto *RSI = dyn_cast<CapturedRegionScopeInfo>(CSI)) {
+ // OpenMP private variables should not be captured in outer scope, so
+ // just break here.
+ if (RSI->CapRegionKind == CR_OpenMP) {
+ if (isOpenMPPrivateVar(Var, OpenMPLevel)) {
+ Nested = true;
+ DeclRefType = DeclRefType.getUnqualifiedType();
+ CaptureType = Context.getLValueReferenceType(DeclRefType);
+ break;
+ }
+ ++OpenMPLevel;
+ }
+ }
+ }
if (CSI->ImpCaptureStyle == CapturingScopeInfo::ImpCap_None && !Explicit) {
// No capture-default, and this is not an explicit capture
// so cannot capture this variable.
OpenPOWER on IntegriCloud