diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-14 22:37:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-14 22:37:11 +0000 |
commit | 4fd0ea01660d7e447f072a1032abf0d7537821bf (patch) | |
tree | 74166ede2e1c551ba54d89102998b5737154330e /lib/Target/X86/X86ISelLowering.cpp | |
parent | 6135a96792ca05f6366e5dbaee6208e84589c47f (diff) | |
download | external_llvm-4fd0ea01660d7e447f072a1032abf0d7537821bf.zip external_llvm-4fd0ea01660d7e447f072a1032abf0d7537821bf.tar.gz external_llvm-4fd0ea01660d7e447f072a1032abf0d7537821bf.tar.bz2 |
simplify getPICBaseSymbol a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1c5c510..103c70b 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -1104,11 +1104,12 @@ unsigned X86TargetLowering::getJumpTableEncoding() const { /// getPICBaseSymbol - Return the X86-32 PIC base. MCSymbol * -X86TargetLowering::getPICBaseSymbol(const MachineFunction *MF, - MCContext &Ctx) const { +X86TargetLowering::getPICBaseSymbol(const MachineFunction &MF) const { + const MCAsmInfo &MAI = *getTargetMachine().getMCAsmInfo(); + MCContext &Ctx = MF.getContext(); return Ctx.GetOrCreateSymbol(Twine(MAI.getPrivateGlobalPrefix())+ - Twine(MF->getFunctionNumber())+"$pb"); + Twine(MF.getFunctionNumber())+"$pb"); } @@ -1146,7 +1147,7 @@ getPICJumpTableRelocBaseExpr(const MachineFunction *MF, unsigned JTI, return TargetLowering::getPICJumpTableRelocBaseExpr(MF, JTI, Ctx); // Otherwise, the reference is relative to the PIC base. - return MCSymbolRefExpr::Create(getPICBaseSymbol(MF, Ctx), Ctx); + return MCSymbolRefExpr::Create(getPICBaseSymbol(*MF), Ctx); } /// getFunctionAlignment - Return the Log2 alignment of this function. |