mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-11 14:57:05 +00:00
getFunctionAlignment should return log2 alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83242 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3825ce8c24
commit
048e36f536
@ -542,7 +542,7 @@ const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const {
|
|||||||
|
|
||||||
/// getFunctionAlignment - Return the Log2 alignment of this function.
|
/// getFunctionAlignment - Return the Log2 alignment of this function.
|
||||||
unsigned ARMTargetLowering::getFunctionAlignment(const Function *F) const {
|
unsigned ARMTargetLowering::getFunctionAlignment(const Function *F) const {
|
||||||
return getTargetMachine().getSubtarget<ARMSubtarget>().isThumb() ? 1 : 2;
|
return getTargetMachine().getSubtarget<ARMSubtarget>().isThumb() ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -252,8 +252,9 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
printVisibility(CurrentFnName, F->getVisibility());
|
printVisibility(CurrentFnName, F->getVisibility());
|
||||||
|
|
||||||
|
unsigned FnAlign = 1 << MF.getAlignment(); // MF alignment is log2.
|
||||||
if (AFI->isThumbFunction()) {
|
if (AFI->isThumbFunction()) {
|
||||||
EmitAlignment(MF.getAlignment(), F, AFI->getAlign());
|
EmitAlignment(FnAlign, F, AFI->getAlign());
|
||||||
O << "\t.code\t16\n";
|
O << "\t.code\t16\n";
|
||||||
O << "\t.thumb_func";
|
O << "\t.thumb_func";
|
||||||
if (Subtarget->isTargetDarwin())
|
if (Subtarget->isTargetDarwin())
|
||||||
@ -261,7 +262,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
O << "\n";
|
O << "\n";
|
||||||
InCPMode = false;
|
InCPMode = false;
|
||||||
} else {
|
} else {
|
||||||
EmitAlignment(MF.getAlignment(), F);
|
EmitAlignment(FnAlign, F);
|
||||||
}
|
}
|
||||||
|
|
||||||
O << CurrentFnName << ":\n";
|
O << CurrentFnName << ":\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user