MC: Move MCAlignFragment::EmitNops value out of the constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103665 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index d5ff949..0bab34e 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -498,7 +498,7 @@
// the Count bytes. Then if that did not fill any bytes or there are any
// bytes left to fill use the the Value and ValueSize to fill the rest.
// If we are aligning with nops, ask that target to emit the right data.
- if (AF.getEmitNops()) {
+ if (AF.hasEmitNops()) {
if (!Asm.getBackend().WriteNopData(Count, OW))
report_fatal_error("unable to write nop sequence of " +
Twine(Count) + " bytes");
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp
index fe701a7..62abf74 100644
--- a/lib/MC/MCMachOStreamer.cpp
+++ b/lib/MC/MCMachOStreamer.cpp
@@ -323,8 +323,7 @@
// Emit an align fragment if necessary.
if (ByteAlignment != 1)
- new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, /*EmitNops=*/false,
- &SectData);
+ new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, &SectData);
MCFragment *F = new MCFillFragment(0, 0, Size, &SectData);
SD.setFragment(F);
@@ -365,8 +364,7 @@
if (MaxBytesToEmit == 0)
MaxBytesToEmit = ByteAlignment;
MCFragment *F = new MCAlignFragment(ByteAlignment, Value, ValueSize,
- MaxBytesToEmit, /*EmitNops=*/false,
- CurSectionData);
+ MaxBytesToEmit, CurSectionData);
F->setAtom(CurrentAtomMap.lookup(CurSectionData));
// Update the maximum alignment on the current section if necessary.
@@ -378,8 +376,9 @@
unsigned MaxBytesToEmit) {
if (MaxBytesToEmit == 0)
MaxBytesToEmit = ByteAlignment;
- MCFragment *F = new MCAlignFragment(ByteAlignment, 0, 1, MaxBytesToEmit,
- /*EmitNops=*/true, CurSectionData);
+ MCAlignFragment *F = new MCAlignFragment(ByteAlignment, 0, 1, MaxBytesToEmit,
+ CurSectionData);
+ F->setEmitNops(true);
F->setAtom(CurrentAtomMap.lookup(CurSectionData));
// Update the maximum alignment on the current section if necessary.