diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-19 16:57:08 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-19 16:57:08 +0000 |
commit | 9f9435ed260c07bfe732e00217d80e1df840fff8 (patch) | |
tree | e3a977548b173f367d43a6e43531a0c7e365208e /lib/MC/MCAssembler.cpp | |
parent | 8f77ee21670505950073f2d116ced9a011e861a2 (diff) | |
download | llvm-9f9435ed260c07bfe732e00217d80e1df840fff8.tar.gz |
Simplify MCFillFragment.
The value size was always 1 or 0, so we don't need to store it.
In a no asserts build this takes the testcase of pr26208 from 11 to 10
seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 15e82fa49388..a88e3df88ffd 100644 --- a/lib/MC/MCAssembler.cpp +++ b/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; } |