diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-07-16 16:49:20 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-07-16 16:49:20 +0000 |
commit | 3dd1f9d61d4f6426a072b7812146115e99a23b53 (patch) | |
tree | 543728e77d81aa44fed3016b7713f0c4ebd8b0cf /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | |
parent | b79b4f539bebc91350c153a6d7aaa091eb945c73 (diff) | |
download | bcm5719-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.cpp | 2 |
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. |