diff --git a/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp index 7d9759726ea2..5a1b4921ad3e 100644 --- a/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp +++ b/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp @@ -54,7 +54,6 @@ namespace { void printInstruction(const MachineInstr *MI); // autogenerated. static const char *getRegisterName(unsigned RegNo); - void emitLinkage(const MCSymbol *GVSym, GlobalValue::LinkageTypes l); bool runOnMachineFunction(MachineFunction &F); bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode); @@ -69,47 +68,14 @@ extern "C" void LLVMInitializeBlackfinAsmPrinter() { RegisterAsmPrinter X(TheBlackfinTarget); } -void BlackfinAsmPrinter::emitLinkage(const MCSymbol *GVSym, - GlobalValue::LinkageTypes L) { - switch (L) { - default: llvm_unreachable("Unknown linkage type!"); - case GlobalValue::InternalLinkage: // Symbols default to internal. - case GlobalValue::PrivateLinkage: - case GlobalValue::LinkerPrivateLinkage: - break; - case GlobalValue::ExternalLinkage: - O << MAI->getGlobalDirective() << *GVSym << "\n"; - break; - case GlobalValue::LinkOnceAnyLinkage: - case GlobalValue::LinkOnceODRLinkage: - case GlobalValue::WeakAnyLinkage: - case GlobalValue::WeakODRLinkage: - O << MAI->getGlobalDirective() << *GVSym << "\n"; - O << MAI->getWeakDefDirective() << *GVSym << "\n"; - break; - } -} - /// runOnMachineFunction - This uses the printInstruction() /// method to print assembly for each instruction. /// bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { SetupMachineFunction(MF); - EmitConstantPool(MF.getConstantPool()); - EmitJumpTableInfo(MF); - - const Function *F = MF.getFunction(); - OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); - EmitAlignment(2, F); - emitLinkage(CurrentFnSym, F->getLinkage()); - printVisibility(CurrentFnSym, F->getVisibility()); - - O << "\t.type\t" << *CurrentFnSym << ", STT_FUNC\n"; - O << *CurrentFnSym << ":\n"; - - if (DW) - DW->BeginFunction(&MF); - + + EmitFunctionHeader(); + // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { @@ -131,6 +97,8 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { } } + EmitJumpTableInfo(MF); + O << "\t.size " << *CurrentFnSym << ", .-" << *CurrentFnSym << "\n"; if (DW)