[OpenMP] Add TLS-based implementation for threadprivate directive.
llvm-svn: 242080
This commit is contained in:
@@ -1262,6 +1262,11 @@ bool CodeGenModule::MayBeEmittedEagerly(const ValueDecl *Global) {
|
||||
// Implicit template instantiations may change linkage if they are later
|
||||
// explicitly instantiated, so they should not be emitted eagerly.
|
||||
return false;
|
||||
// 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))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user