AArch64: assert code model is small for TLS accesses
authorTim Northover <Tim.Northover@arm.com>
Sat, 4 May 2013 16:54:11 +0000 (16:54 +0000)
committerTim Northover <Tim.Northover@arm.com>
Sat, 4 May 2013 16:54:11 +0000 (16:54 +0000)
Supporting TLS in the large memory model is rather difficult at the
moment, so make sure no-one gets into difficulties by mistake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181121 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64ISelLowering.cpp

index dfc5ad01dd419fea12dff782d5ac62d458a995d5..56f675183cb4c8c51d70357c63ba4cabc5ad27bc 100644 (file)
@@ -2025,6 +2025,8 @@ AArch64TargetLowering::LowerGlobalTLSAddress(SDValue Op,
                                              SelectionDAG &DAG) const {
   assert(Subtarget->isTargetELF() &&
          "TLS not implemented for non-ELF targets");
+  assert(getTargetMachine().getCodeModel() == CodeModel::Small
+         && "TLS only supported in small memory model");
   const GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
 
   TLSModel::Model Model = getTargetMachine().getTLSModel(GA->getGlobal());