1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00

make X86ATTAsmPrinter::PrintPICBaseSymbol forward to X86MCInstLower.

llvm-svn: 81685
This commit is contained in:
Chris Lattner 2009-09-13 18:33:59 +00:00
parent cbcbedf254
commit 9e536003ba
2 changed files with 7 additions and 9 deletions

View File

@ -15,6 +15,7 @@
#define DEBUG_TYPE "asm-printer"
#include "X86ATTAsmPrinter.h"
#include "X86MCInstLower.h"
#include "X86.h"
#include "X86COFF.h"
#include "X86MachineFunctionInfo.h"
@ -46,14 +47,9 @@ STATISTIC(EmittedInsts, "Number of machine instrs printed");
//===----------------------------------------------------------------------===//
void X86ATTAsmPrinter::PrintPICBaseSymbol() const {
// FIXME: the actual label generated doesn't matter here! Just mangle in
// something unique (the function number) with Private prefix.
if (Subtarget->isTargetDarwin())
O << "\"L" << getFunctionNumber() << "$pb\"";
else {
assert(Subtarget->isTargetELF() && "Don't know how to print PIC label!");
O << ".Lllvm$" << getFunctionNumber() << ".$piclabel";
}
// FIXME: Gross const cast hack.
X86ATTAsmPrinter *AP = const_cast<X86ATTAsmPrinter*>(this);
X86MCInstLower(OutContext, 0, *AP).GetPICBaseSymbol()->print(O, MAI);
}
static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,

View File

@ -10,6 +10,8 @@
#ifndef X86_MCINSTLOWER_H
#define X86_MCINSTLOWER_H
#include "llvm/Support/Compiler.h"
namespace llvm {
class MCContext;
class MCInst;
@ -22,7 +24,7 @@ namespace llvm {
class X86Subtarget;
/// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
class X86MCInstLower {
class VISIBILITY_HIDDEN X86MCInstLower {
MCContext &Ctx;
Mangler *Mang;
X86ATTAsmPrinter &AsmPrinter;