Mac OS X should use 0x90 to fill in gaps to satisfy function alignment requirements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40501 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-07-25 23:36:05 +00:00
parent 73a259a9d1
commit ad5e9cac02

View File

@ -99,19 +99,28 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
switch (F->getLinkage()) { switch (F->getLinkage()) {
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.
if (Subtarget->isTargetDarwin())
// FIXME: This should be parameterized somewhere.
EmitAlignment(4, F, 0, true, 0x90);
else
EmitAlignment(4, F); // FIXME: This should be parameterized somewhere. EmitAlignment(4, F); // FIXME: This should be parameterized somewhere.
break; break;
case Function::DLLExportLinkage: case Function::DLLExportLinkage:
DLLExportedFns.insert(Mang->makeNameProper(F->getName(), "")); DLLExportedFns.insert(Mang->makeNameProper(F->getName(), ""));
//FALLS THROUGH //FALLS THROUGH
case Function::ExternalLinkage: case Function::ExternalLinkage:
if (Subtarget->isTargetDarwin())
// FIXME: This should be parameterized somewhere.
EmitAlignment(4, F, 0, true, 0x90);
else
EmitAlignment(4, F); // FIXME: This should be parameterized somewhere. EmitAlignment(4, F); // FIXME: This should be parameterized somewhere.
O << "\t.globl\t" << CurrentFnName << "\n"; O << "\t.globl\t" << CurrentFnName << "\n";
break; break;
case Function::LinkOnceLinkage: case Function::LinkOnceLinkage:
case Function::WeakLinkage: case Function::WeakLinkage:
if (Subtarget->isTargetDarwin()) { if (Subtarget->isTargetDarwin()) {
EmitAlignment(4, F); // FIXME: This should be parameterized somewhere. // FIXME: This should be parameterized somewhere.
EmitAlignment(4, F, 0, true, 0x90);
O << "\t.globl\t" << CurrentFnName << "\n"; O << "\t.globl\t" << CurrentFnName << "\n";
O << "\t.weak_definition\t" << CurrentFnName << "\n"; O << "\t.weak_definition\t" << CurrentFnName << "\n";
} else if (Subtarget->isTargetCygMing()) { } else if (Subtarget->isTargetCygMing()) {