Make sure that weak functions are aligned properly

llvm-svn: 26181
This commit is contained in:
Chris Lattner 2006-02-14 20:42:33 +00:00
parent 26c6d7609c
commit 02f3db9781

View File

@ -464,11 +464,9 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
default: assert(0 && "Unknown linkage type!"); default: assert(0 && "Unknown linkage type!");
case Function::InternalLinkage: // Symbols default to internal. case Function::InternalLinkage: // Symbols default to internal.
SwitchSection(".text", F); SwitchSection(".text", F);
EmitAlignment(4, F);
break; break;
case Function::ExternalLinkage: case Function::ExternalLinkage:
SwitchSection(".text", F); SwitchSection(".text", F);
EmitAlignment(4, F);
O << "\t.globl\t" << CurrentFnName << "\n"; O << "\t.globl\t" << CurrentFnName << "\n";
break; break;
case Function::WeakLinkage: case Function::WeakLinkage:
@ -479,6 +477,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
O << "\t.weak_definition\t" << CurrentFnName << "\n"; O << "\t.weak_definition\t" << CurrentFnName << "\n";
break; break;
} }
EmitAlignment(4, F);
O << CurrentFnName << ":\n"; O << CurrentFnName << ":\n";
// Print out code for the function. // Print out code for the function.