From 96edb2e37e7614be21e52504c1246c96b6e5f65d Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 25 Jun 2018 15:32:05 +0000 Subject: [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 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') 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(Global)) + getContext().getTargetInfo().isTLSSupported() && isa(Global) && + !isTypeConstant(Global->getType(), false)) return false; return true; -- cgit v1.2.3