linkage fix for weak functions

llvm-svn: 25976
This commit is contained in:
Andrew Lenharth 2006-02-04 19:13:09 +00:00
parent 95ae171d5b
commit 1fcff15f86
1 changed files with 16 additions and 3 deletions

View File

@ -173,9 +173,22 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
EmitConstantPool(MF.getConstantPool());
// Print out labels for the function.
SwitchSection("\t.section .text", MF.getFunction());
EmitAlignment(4);
O << "\t.globl " << CurrentFnName << "\n";
const Function *F = MF.getFunction();
SwitchSection(".text", F);
EmitAlignment(4, F);
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
case Function::InternalLinkage: // Symbols default to internal.
break;
case Function::ExternalLinkage:
O << "\t.globl " << CurrentFnName << "\n";
break;
case Function::WeakLinkage:
case Function::LinkOnceLinkage:
O << "\t.weak " << CurrentFnName << "\n";
break;
}
O << "\t.ent " << CurrentFnName << "\n";
O << CurrentFnName << ":\n";