aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-14 22:37:11 +0000
committerChris Lattner <sabre@nondot.org>2010-11-14 22:37:11 +0000
commit4fd0ea01660d7e447f072a1032abf0d7537821bf (patch)
tree74166ede2e1c551ba54d89102998b5737154330e /lib/Target/X86/X86ISelLowering.cpp
parent6135a96792ca05f6366e5dbaee6208e84589c47f (diff)
downloadexternal_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.cpp9
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.