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 | 1a7e8b4bc1cde3fea2de164c26bb499bfce3ad39 (patch) | |
tree | 28d555934883814def28ee484a60856fb9efe8b3 /llvm/lib/MC/MCAssembler.cpp | |
parent | 9e8c6c1731edab16636ad4e8fc7aacb2c028f34d (diff) | |
download | bcm5719-llvm-1a7e8b4bc1cde3fea2de164c26bb499bfce3ad39.tar.gz bcm5719-llvm-1a7e8b4bc1cde3fea2de164c26bb499bfce3ad39.zip |
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.
llvm-svn: 258141
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r-- | llvm/lib/MC/MCAssembler.cpp | 16 |
1 files changed, 3 insertions, 13 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; } |