summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-06-25 15:32:05 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-06-25 15:32:05 +0000
commit96edb2e37e7614be21e52504c1246c96b6e5f65d (patch)
treead07ce9dde9648460085dedc03c9141b041f0551 /clang/lib/CodeGen/CodeGenModule.cpp
parent32287ad897690ad37bed7a13a16174587ae29a16 (diff)
downloadbcm5719-llvm-96edb2e37e7614be21e52504c1246c96b6e5f65d.tar.gz
bcm5719-llvm-96edb2e37e7614be21e52504c1246c96b6e5f65d.zip
[OPENMP] Do not consider address constant vars as possibly
threadprivate. Do not delay emission of the address constant variables in OpenMP mode as they cannot be defined as threadprivate. llvm-svn: 335483
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 6595694ebd5..5a2f2a01d39 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1914,7 +1914,8 @@ bool CodeGenModule::MayBeEmittedEagerly(const ValueDecl *Global) {
// If OpenMP is enabled and threadprivates must be generated like TLS, delay
// codegen for global variables, because they may be marked as threadprivate.
if (LangOpts.OpenMP && LangOpts.OpenMPUseTLS &&
- getContext().getTargetInfo().isTLSSupported() && isa<VarDecl>(Global))
+ getContext().getTargetInfo().isTLSSupported() && isa<VarDecl>(Global) &&
+ !isTypeConstant(Global->getType(), false))
return false;
return true;
OpenPOWER on IntegriCloud