[llvm-commits] [llvm] r146340 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sun Dec 11 04:21:35 PST 2011
Author: d0k
Date: Sun Dec 11 06:21:34 2011
New Revision: 146340
URL: http://llvm.org/viewvc/llvm-project?rev=146340&view=rev
Log:
Mips: Don't create a dangling IR function just to get the address of a symbol.
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=146340&r1=146339&r2=146340&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sun Dec 11 06:21:34 2011
@@ -1553,12 +1553,7 @@
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;
More information about the llvm-commits
mailing list