summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-03-13 20:46:28 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-03-13 20:46:28 +0000
commitab41ea6282a75c3ece5cef037ced75f3f7acc724 (patch)
tree0178b23b113ba4038b9b9a51f092e6a07c612ff1 /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parentf653e56a6773ca1ba52f45d8ea89307fe16d3868 (diff)
downloadbcm5719-llvm-ab41ea6282a75c3ece5cef037ced75f3f7acc724.tar.gz
bcm5719-llvm-ab41ea6282a75c3ece5cef037ced75f3f7acc724.zip
[OPENMP]Fix PR37283: Assertion failure on openmp task with by reference
array. If the firstprivate variable is a reference, we may incorrectly classify the kind of the private copy. Use the type of the private copy instead of the original shared variable. llvm-svn: 356098
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 4ed63e0084c..f3a0f0d5955 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -4705,7 +4705,7 @@ static void emitPrivatesInit(CodeGenFunction &CGF,
// Check if the variable is the target-based BasePointersArray,
// PointersArray or SizesArray.
LValue SharedRefLValue;
- QualType Type = OriginalVD->getType();
+ QualType Type = PrivateLValue.getType();
const FieldDecl *SharedField = CapturesInfo.lookup(OriginalVD);
if (IsTargetTask && !SharedField) {
assert(isa<ImplicitParamDecl>(OriginalVD) &&
OpenPOWER on IntegriCloud