mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Allow targets to specify a minimum supported NOP size when performing NOP padding. If the desired padding is smaller than the supported NOP size,
we will enlarge the padding to make it work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -325,6 +325,12 @@ uint64_t MCAssembler::computeFragmentSize(const MCAsmLayout &Layout,
|
||||
const MCAlignFragment &AF = cast<MCAlignFragment>(F);
|
||||
unsigned Offset = Layout.getFragmentOffset(&AF);
|
||||
unsigned Size = OffsetToAlignment(Offset, AF.getAlignment());
|
||||
// If we are padding with nops, force the padding to be larger than the
|
||||
// minimum nop size.
|
||||
if (Size > 0 && AF.hasEmitNops()) {
|
||||
while (Size % getBackend().getMinimumNopSize())
|
||||
Size += AF.getAlignment();
|
||||
}
|
||||
if (Size > AF.getMaxBytesToEmit())
|
||||
return 0;
|
||||
return Size;
|
||||
|
Reference in New Issue
Block a user