diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-12-11 12:21:34 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-12-11 12:21:34 +0000 |
commit | 5eccf674928a050be09d60d1b5d2a843eff5f2ed (patch) | |
tree | 74575b1aa2f2046b3e324167aafdb7036465d42c | |
parent | 08216787ae1106ed46990317d5f5363925a40175 (diff) | |
download | llvm-5eccf674928a050be09d60d1b5d2a843eff5f2ed.tar.gz llvm-5eccf674928a050be09d60d1b5d2a843eff5f2ed.tar.bz2 llvm-5eccf674928a050be09d60d1b5d2a843eff5f2ed.tar.xz |
Mips: Don't create a dangling IR function just to get the address of a symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146340 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Mips/MipsISelLowering.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp index 4bd3d8afb8..4df84ee3cd 100644 --- a/lib/Target/Mips/MipsISelLowering.cpp +++ b/lib/Target/Mips/MipsISelLowering.cpp @@ -1553,12 +1553,7 @@ LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const unsigned PtrSize = PtrVT.getSizeInBits(); IntegerType *PtrTy = Type::getIntNTy(*DAG.getContext(), PtrSize); - SmallVector<Type*, 1> Params; - Params.push_back(PtrTy); - FunctionType *FuncTy = FunctionType::get(PtrTy, Params, false); - Function *Func = Function::Create(FuncTy, GlobalValue::ExternalLinkage, - "__tls_get_addr"); - SDValue TlsGetAddr = DAG.getGlobalAddress(Func, dl, PtrVT); + SDValue TlsGetAddr = DAG.getExternalSymbol("__tls_get_addr", PtrVT); ArgListTy Args; ArgListEntry Entry; |