diff options
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/MCAssembler.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/MC/MCFragment.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/MC/MCMachOStreamer.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/MC/MCObjectStreamer.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/MC/WinCOFFStreamer.cpp | 2 |
5 files changed, 8 insertions, 19 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 15e82fa4938..a88e3df88ff 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -489,17 +489,8 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout, ++stats::EmittedFillFragments; const MCFillFragment &FF = cast<MCFillFragment>(F); - assert(FF.getValueSize() && "Invalid virtual align in concrete fragment!"); - - for (uint64_t i = 0, e = FF.getSize() / FF.getValueSize(); i != e; ++i) { - switch (FF.getValueSize()) { - default: llvm_unreachable("Invalid size!"); - case 1: OW->write8 (uint8_t (FF.getValue())); break; - case 2: OW->write16(uint16_t(FF.getValue())); break; - case 4: OW->write32(uint32_t(FF.getValue())); break; - case 8: OW->write64(uint64_t(FF.getValue())); break; - } - } + for (uint64_t I = 0, E = FF.getSize(); I != E; ++I) + OW->write8(FF.getValue()); break; } @@ -578,8 +569,7 @@ void MCAssembler::writeSectionData(const MCSection *Sec, "Invalid align in virtual section!"); break; case MCFragment::FT_Fill: - assert((cast<MCFillFragment>(F).getValueSize() == 0 || - cast<MCFillFragment>(F).getValue() == 0) && + assert((cast<MCFillFragment>(F).getValue() == 0) && "Invalid fill in virtual section!"); break; } diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp index efdb7049203..09570d7fbe4 100644 --- a/llvm/lib/MC/MCFragment.cpp +++ b/llvm/lib/MC/MCFragment.cpp @@ -386,8 +386,7 @@ void MCFragment::dump() { } case MCFragment::FT_Fill: { const MCFillFragment *FF = cast<MCFillFragment>(this); - OS << " Value:" << FF->getValue() << " ValueSize:" << FF->getValueSize() - << " Size:" << FF->getSize(); + OS << " Value:" << FF->getValue() << " Size:" << FF->getSize(); break; } case MCFragment::FT_Relaxable: { diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp index 21f7571eec4..578ae962007 100644 --- a/llvm/lib/MC/MCMachOStreamer.cpp +++ b/llvm/lib/MC/MCMachOStreamer.cpp @@ -414,7 +414,7 @@ void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, if (ByteAlignment != 1) new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, Section); - MCFragment *F = new MCFillFragment(0, 0, Size, Section); + MCFragment *F = new MCFillFragment(0, Size, Section); Symbol->setFragment(F); // Update the maximum alignment on the zero fill section if necessary. diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index 972610ac8d6..8ee24786967 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -436,9 +436,9 @@ bool MCObjectStreamer::EmitRelocDirective(const MCExpr &Offset, StringRef Name, void MCObjectStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue) { const MCSection *Sec = getCurrentSection().first; + (void)Sec; assert(Sec && "need a section"); - unsigned ItemSize = Sec->isVirtualSection() ? 0 : 1; - insert(new MCFillFragment(FillValue, ItemSize, NumBytes)); + insert(new MCFillFragment(FillValue, NumBytes)); } void MCObjectStreamer::FinishImpl() { diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp index a38b1a41a9b..f9d231921d5 100644 --- a/llvm/lib/MC/WinCOFFStreamer.cpp +++ b/llvm/lib/MC/WinCOFFStreamer.cpp @@ -258,7 +258,7 @@ void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, ByteAlignment, Section); MCFillFragment *Fragment = new MCFillFragment( - /*Value=*/0, /*ValueSize=*/0, Size, Section); + /*Value=*/0, Size, Section); Symbol->setFragment(Fragment); } |