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
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 15e82fa4..a88e3df 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -489,17 +489,8 @@
++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 @@
"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;
}