summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-08-22 17:54:52 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-08-22 17:54:52 +0000
commit6a71f364f175a94a92cb26908b36d972734a611d (patch)
tree77037ca5b4040397e681d8951cddc290b944665a /clang/lib/CodeGen/CGExpr.cpp
parent6bfeba24d39ed0915ebb5867df650ac7db3eb5dd (diff)
downloadbcm5719-llvm-6a71f364f175a94a92cb26908b36d972734a611d.tar.gz
bcm5719-llvm-6a71f364f175a94a92cb26908b36d972734a611d.zip
[OPENMP] Fix for PR34014: OpenMP 4.5: Target construct in static method
of class fails to map class static variable. If the global variable is captured and it has several redeclarations, sometimes it may lead to a compiler crash. Patch fixes this by working only with canonical declarations. llvm-svn: 311479
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 0217efb9fb4..93ca6011e16 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2300,6 +2300,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
// Check for captured variables.
if (E->refersToEnclosingVariableOrCapture()) {
+ VD = VD->getCanonicalDecl();
if (auto *FD = LambdaCaptureFields.lookup(VD))
return EmitCapturedFieldLValue(*this, FD, CXXABIThisValue);
else if (CapturedStmtInfo) {
OpenPOWER on IntegriCloud