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 | 239f9a35edfeca699e35112938b23c555065dbfd (patch) | |
tree | 86c3ceb96a818a52fc82a2a571dee99e0f96028e /llvm/lib/Target/X86/X86ISelLowering.cpp | |
parent | 94f0c14cb02bbdf2ac93debe1ceb83cd3355ca52 (diff) | |
download | bcm5719-llvm-239f9a35edfeca699e35112938b23c555065dbfd.tar.gz bcm5719-llvm-239f9a35edfeca699e35112938b23c555065dbfd.zip |
simplify getPICBaseSymbol a bit.
llvm-svn: 119088
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 1c5c5108ae1..103c70b86f0 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/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. |