simplify getPICBaseSymbol a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-11-14 22:37:11 +00:00
parent 6135a96792
commit 4fd0ea0166
4 changed files with 8 additions and 8 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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;

View File

@ -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