[llvm-commits] [llvm] r119088 - in /llvm/trunk/lib/Target/X86: X86AsmPrinter.cpp X86ISelLowering.cpp X86ISelLowering.h X86MCInstLower.cpp
Chris Lattner
sabre at nondot.org
Sun Nov 14 14:37:11 PST 2010
Author: lattner
Date: Sun Nov 14 16:37:11 2010
New Revision: 119088
URL: http://llvm.org/viewvc/llvm-project?rev=119088&view=rev
Log:
simplify getPICBaseSymbol a bit.
Modified:
llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.h
llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=119088&r1=119087&r2=119088&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Sun Nov 14 16:37:11 2010
@@ -50,8 +50,7 @@
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.
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=119088&r1=119087&r2=119088&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Nov 14 16:37:11 2010
@@ -1104,11 +1104,12 @@
/// 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 @@
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.
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=119088&r1=119087&r2=119088&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Sun Nov 14 16:37:11 2010
@@ -431,7 +431,7 @@
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;
Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=119088&r1=119087&r2=119088&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Sun Nov 14 16:37:11 2010
@@ -41,7 +41,7 @@
MCSymbol *X86MCInstLower::GetPICBaseSymbol() const {
return static_cast<const X86TargetLowering*>(TM.getTargetLowering())->
- getPICBaseSymbol(&MF, Ctx);
+ getPICBaseSymbol(MF);
}
/// GetSymbolFromOperand - Lower an MO_GlobalAddress or MO_ExternalSymbol
More information about the llvm-commits
mailing list