diff options
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.h | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86MCInstLower.cpp | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 065342f2ab..8aa25923ca 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -50,8 +50,7 @@ using namespace llvm; void X86AsmPrinter::PrintPICBaseSymbol(raw_ostream &O) const { const TargetLowering *TLI = TM.getTargetLowering(); - O << *static_cast<const X86TargetLowering*>(TLI)->getPICBaseSymbol(MF, - OutContext); + O << *static_cast<const X86TargetLowering*>(TLI)->getPICBaseSymbol(*MF); } /// runOnMachineFunction - Emit the function body. diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1c5c5108ae..103c70b86f 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. diff --git a/lib/Target/X86/X86ISelLowering.h b/lib/Target/X86/X86ISelLowering.h index bc79719f2c..b6a255332a 100644 --- a/lib/Target/X86/X86ISelLowering.h +++ b/lib/Target/X86/X86ISelLowering.h @@ -431,7 +431,7 @@ namespace llvm { explicit X86TargetLowering(X86TargetMachine &TM); /// getPICBaseSymbol - Return the X86-32 PIC base. - MCSymbol *getPICBaseSymbol(const MachineFunction *MF, MCContext &Ctx) const; + MCSymbol *getPICBaseSymbol(const MachineFunction &MF) const; virtual unsigned getJumpTableEncoding() const; diff --git a/lib/Target/X86/X86MCInstLower.cpp b/lib/Target/X86/X86MCInstLower.cpp index 03c059528e..ffa4ab93c6 100644 --- a/lib/Target/X86/X86MCInstLower.cpp +++ b/lib/Target/X86/X86MCInstLower.cpp @@ -41,7 +41,7 @@ MachineModuleInfoMachO &X86MCInstLower::getMachOMMI() const { MCSymbol *X86MCInstLower::GetPICBaseSymbol() const { return static_cast<const X86TargetLowering*>(TM.getTargetLowering())-> - getPICBaseSymbol(&MF, Ctx); + getPICBaseSymbol(MF); } /// GetSymbolFromOperand - Lower an MO_GlobalAddress or MO_ExternalSymbol |