mirror of
https://github.com/intel/llvm.git
synced 2026-02-02 02:00:03 +08:00
[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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user