From 7077efe894cd456e57763f05ffb51e544a2a147e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 14 Nov 2010 22:48:15 +0000 Subject: move the pic base symbol stuff up to MachineFunction since it is trivial and will be shared between ppc and x86. This substantially simplifies the X86 backend also. llvm-svn: 119089 --- llvm/lib/CodeGen/MachineFunction.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index e2c2bd5..e27c860 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -426,6 +426,13 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx, return Ctx.GetOrCreateSymbol(Name.str()); } +/// getPICBaseSymbol - Return a function-local symbol to represent the PIC +/// base. +MCSymbol *MachineFunction::getPICBaseSymbol() const { + const MCAsmInfo &MAI = *Target.getMCAsmInfo(); + return Ctx.GetOrCreateSymbol(Twine(MAI.getPrivateGlobalPrefix())+ + Twine(getFunctionNumber())+"$pb"); +} //===----------------------------------------------------------------------===// // MachineFrameInfo implementation -- cgit v1.1