summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-07-16 16:49:20 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-07-16 16:49:20 +0000
commit3dd1f9d61d4f6426a072b7812146115e99a23b53 (patch)
tree543728e77d81aa44fed3016b7713f0c4ebd8b0cf /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
parentb79b4f539bebc91350c153a6d7aaa091eb945c73 (diff)
downloadbcm5719-llvm-3dd1f9d61d4f6426a072b7812146115e99a23b53.tar.gz
bcm5719-llvm-3dd1f9d61d4f6426a072b7812146115e99a23b53.zip
[OPENMP, NVPTX] Globalize only captured variables.
Sometimes we can try to globalize non-variable declarations, which may lead to compiler crash. llvm-svn: 337191
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
index ba87e059081..5aaebff8f76 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
@@ -204,7 +204,7 @@ class CheckVarsEscapingDeclContext final
void markAsEscaped(const ValueDecl *VD) {
// Do not globalize declare target variables.
- if (isDeclareTargetDeclaration(VD))
+ if (!isa<VarDecl>(VD) || isDeclareTargetDeclaration(VD))
return;
VD = cast<ValueDecl>(VD->getCanonicalDecl());
// Variables captured by value must be globalized.
OpenPOWER on IntegriCloud