aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips/MipsISelLowering.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-06-04 14:02:08 +0000
committerHans Wennborg <hans@hanshq.net>2012-06-04 14:02:08 +0000
commit70a07c7fc437045a2421d279a99b19981f08acc2 (patch)
tree9d5f8c3aab6f3ac3753b54bb19c5c290a39e6d9d /lib/Target/Mips/MipsISelLowering.cpp
parentfcb2c3cf5e8ee421fd3a5639cc4a33036e9a614e (diff)
downloadexternal_llvm-70a07c7fc437045a2421d279a99b19981f08acc2.zip
external_llvm-70a07c7fc437045a2421d279a99b19981f08acc2.tar.gz
external_llvm-70a07c7fc437045a2421d279a99b19981f08acc2.tar.bz2
MIPS TLS: use the model selected by TargetMachine::getTLSModel().
This was mostly done already in r156162, but I missed one place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsISelLowering.cpp')
-rw-r--r--lib/Target/Mips/MipsISelLowering.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp
index 6b39b90..d44bdca 100644
--- a/lib/Target/Mips/MipsISelLowering.cpp
+++ b/lib/Target/Mips/MipsISelLowering.cpp
@@ -1648,9 +1648,10 @@ LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const
TLSModel::Model model = getTargetMachine().getTLSModel(GV);
if (model == TLSModel::GeneralDynamic || model == TLSModel::LocalDynamic) {
- // General Dynamic TLS Model
- bool LocalDynamic = GV->hasInternalLinkage();
- unsigned Flag = LocalDynamic ? MipsII::MO_TLSLDM :MipsII::MO_TLSGD;
+ // General Dynamic and Local Dynamic TLS Model.
+ unsigned Flag = (model == TLSModel::LocalDynamic) ? MipsII::MO_TLSLDM
+ : MipsII::MO_TLSGD;
+
SDValue TGA = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0, Flag);
SDValue Argument = DAG.getNode(MipsISD::Wrapper, dl, PtrVT,
GetGlobalReg(DAG, PtrVT), TGA);