[Cygwin] Enable TLS as emutls.

It resolves clang selfhosting with std::once() for Cygwin.

FIXME: It may be EmulatedTLS-generic also for X86-Android.
FIXME: Pass EmulatedTLS to LLVM CodeGen from Clang with -femulated-tls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256134 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2015-12-21 02:37:23 +00:00
parent 65021c4392
commit d644801757
2 changed files with 14 additions and 0 deletions

View File

@ -105,6 +105,14 @@ Changes to the PowerPC Target
During this release ...
Changes to the X86 Target
-----------------------------
During this release ...
* TLS is enabled for Cygwin as emutls.
Changes to the OCaml bindings
-----------------------------

View File

@ -12258,6 +12258,12 @@ SDValue
X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
// Cygwin uses emutls.
// FIXME: It may be EmulatedTLS-generic also for X86-Android.
if (Subtarget->isTargetWindowsCygwin())
return LowerToTLSEmulatedModel(GA, DAG);
const GlobalValue *GV = GA->getGlobal();
auto PtrVT = getPointerTy(DAG.getDataLayout());