mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO. Also added tests for ELF and COFF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1654,12 +1654,7 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
||||
|
||||
// Check whether we should use optimal code alignment for this .align
|
||||
// directive.
|
||||
//
|
||||
// FIXME: This should be using a target hook.
|
||||
bool UseCodeAlign = false;
|
||||
if (const MCSectionMachO *S = dyn_cast<MCSectionMachO>(
|
||||
getStreamer().getCurrentSection()))
|
||||
UseCodeAlign = S->hasAttribute(MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS);
|
||||
bool UseCodeAlign = getStreamer().getCurrentSection()->UseCodeAlign();
|
||||
if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
|
||||
ValueSize == 1 && UseCodeAlign) {
|
||||
getStreamer().EmitCodeAlignment(Alignment, MaxBytesToFill);
|
||||
|
Reference in New Issue
Block a user