mirror of
https://github.com/openbsd/src.git
synced 2026-05-01 17:46:35 +00:00
Emit trap alignment between basic blocks that are unrechable via
fallthrough. Avoids unnecessary jmp instructions in the middle of functions and makes disassembly nicer to read. ok guenther@ mlarkin@ deraadt@
This commit is contained in:
@@ -2684,11 +2684,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) const {
|
||||
}
|
||||
}
|
||||
|
||||
// Emit an alignment directive for this block, if needed.
|
||||
if (unsigned Align = MBB.getAlignment())
|
||||
EmitAlignment(Align);
|
||||
MCCodePaddingContext Context;
|
||||
setupCodePaddingContext(MBB, Context);
|
||||
// Emit an alignment directive for this block, if needed.
|
||||
if (unsigned Align = MBB.getAlignment()) {
|
||||
if (Context.IsBasicBlockReachableViaFallthrough)
|
||||
EmitAlignment(Align);
|
||||
else
|
||||
EmitTrapAlignment(Align);
|
||||
}
|
||||
OutStreamer->EmitCodePaddingBasicBlockStart(Context);
|
||||
|
||||
// If the block has its address taken, emit any labels that were used to
|
||||
|
||||
Reference in New Issue
Block a user