git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-08-08 18:22:59 +00:00
parent b12ab97bbd
commit 34da127be5

View File

@ -289,13 +289,13 @@ namespace {
virtual void EmitExternalGlobal(const GlobalVariable *GV);
};
/// LinuxAsmPrinter - PowerPC assembly printer, customized for Linux
struct VISIBILITY_HIDDEN LinuxAsmPrinter : public PPCAsmPrinter {
/// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux
struct VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
DwarfWriter DW;
MachineModuleInfo *MMI;
LinuxAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
PPCLinuxAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
const TargetAsmInfo *T)
: PPCAsmPrinter(O, TM, T), DW(O, this, T), MMI(0) {
}
@ -319,14 +319,14 @@ namespace {
virtual std::string getSectionForFunction(const Function &F) const;
};
/// DarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac OS
/// X
struct VISIBILITY_HIDDEN DarwinAsmPrinter : public PPCAsmPrinter {
/// PPCDarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac
/// OS X
struct VISIBILITY_HIDDEN PPCDarwinAsmPrinter : public PPCAsmPrinter {
DwarfWriter DW;
MachineModuleInfo *MMI;
DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
PPCDarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
const TargetAsmInfo *T)
: PPCAsmPrinter(O, TM, T), DW(O, this, T), MMI(0) {
}
@ -564,7 +564,7 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
/// runOnMachineFunction - This uses the printMachineInstruction()
/// method to print assembly for each instruction.
///
bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
SetupMachineFunction(MF);
O << "\n\n";
@ -628,7 +628,7 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
return false;
}
bool LinuxAsmPrinter::doInitialization(Module &M) {
bool PPCLinuxAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
// Emit initial debug information.
@ -656,7 +656,7 @@ static void PrintUnmangledNameSafely(const Value *V, std::ostream &OS) {
OS << *Name;
}
bool LinuxAsmPrinter::doFinalization(Module &M) {
bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
const TargetData *TD = TM.getTargetData();
// Print out module-level global variables here.
@ -770,7 +770,7 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
return AsmPrinter::doFinalization(M);
}
std::string LinuxAsmPrinter::getSectionForFunction(const Function &F) const {
std::string PPCLinuxAsmPrinter::getSectionForFunction(const Function &F) const {
switch (F.getLinkage()) {
default: assert(0 && "Unknown linkage type!");
case Function::ExternalLinkage:
@ -781,7 +781,7 @@ std::string LinuxAsmPrinter::getSectionForFunction(const Function &F) const {
}
}
std::string DarwinAsmPrinter::getSectionForFunction(const Function &F) const {
std::string PPCDarwinAsmPrinter::getSectionForFunction(const Function &F) const {
switch (F.getLinkage()) {
default: assert(0 && "Unknown linkage type!");
case Function::ExternalLinkage:
@ -795,7 +795,7 @@ std::string DarwinAsmPrinter::getSectionForFunction(const Function &F) const {
/// runOnMachineFunction - This uses the printMachineInstruction()
/// method to print assembly for each instruction.
///
bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
SetupMachineFunction(MF);
O << "\n\n";
@ -865,7 +865,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
}
bool DarwinAsmPrinter::doInitialization(Module &M) {
bool PPCDarwinAsmPrinter::doInitialization(Module &M) {
static const char *const CPUDirectives[] = {
"",
"ppc",
@ -918,7 +918,7 @@ bool DarwinAsmPrinter::doInitialization(Module &M) {
return Result;
}
bool DarwinAsmPrinter::doFinalization(Module &M) {
bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
const TargetData *TD = TM.getTargetData();
// Print out module-level global variables here.
@ -1156,7 +1156,6 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
O << "\t.quad\t0\n";
else
O << "\t.long\t0\n";
}
}
@ -1184,9 +1183,8 @@ FunctionPass *llvm::createPPCAsmPrinterPass(std::ostream &o,
const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();
if (Subtarget->isDarwin()) {
return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
} else {
return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
}
}