mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-25 16:31:33 +00:00
Smaller function alignment when optimizing for size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2659343f04
commit
e22e62b5c0
@ -819,7 +819,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (const char *Directive = TAI->getHiddenDirective())
|
||||
O << Directive << CurrentFnName << "\n";
|
||||
|
||||
EmitAlignment(4, F);
|
||||
EmitAlignment(OptimizeForSize ? 2 : 4, F);
|
||||
O << CurrentFnName << ":\n";
|
||||
|
||||
// Emit pre-function debug information.
|
||||
|
@ -98,21 +98,22 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
|
||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
||||
|
||||
unsigned FnAlign = OptimizeForSize ? 1 : 4;
|
||||
switch (F->getLinkage()) {
|
||||
default: assert(0 && "Unknown linkage type!");
|
||||
case Function::InternalLinkage: // Symbols default to internal.
|
||||
EmitAlignment(4, F);
|
||||
EmitAlignment(FnAlign, F);
|
||||
break;
|
||||
case Function::DLLExportLinkage:
|
||||
DLLExportedFns.insert(Mang->makeNameProper(F->getName(), ""));
|
||||
//FALLS THROUGH
|
||||
case Function::ExternalLinkage:
|
||||
EmitAlignment(4, F);
|
||||
EmitAlignment(FnAlign, F);
|
||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||
break;
|
||||
case Function::LinkOnceLinkage:
|
||||
case Function::WeakLinkage:
|
||||
EmitAlignment(4, F);
|
||||
EmitAlignment(FnAlign, F);
|
||||
if (Subtarget->isTargetDarwin()) {
|
||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||
O << TAI->getWeakDefDirective() << CurrentFnName << "\n";
|
||||
|
@ -57,17 +57,18 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
|
||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
||||
|
||||
unsigned FnAlign = OptimizeForSize ? 1 : 4;
|
||||
switch (F->getLinkage()) {
|
||||
default: assert(0 && "Unsupported linkage type!");
|
||||
case Function::InternalLinkage:
|
||||
EmitAlignment(4);
|
||||
EmitAlignment(FnAlign);
|
||||
break;
|
||||
case Function::DLLExportLinkage:
|
||||
DLLExportedFns.insert(CurrentFnName);
|
||||
//FALLS THROUGH
|
||||
case Function::ExternalLinkage:
|
||||
O << "\tpublic " << CurrentFnName << "\n";
|
||||
EmitAlignment(4);
|
||||
EmitAlignment(FnAlign);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user