From a2886c21d9a08d63c324cc61aa91ae0893507a31 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 7 Feb 2012 05:05:23 +0000 Subject: Convert assert(0) to llvm_unreachable llvm-svn: 149967 --- llvm/lib/MC/MCAssembler.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'llvm/lib/MC/MCAssembler.cpp') diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 0087f67b434..c041f65640a 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -348,8 +348,7 @@ uint64_t MCAssembler::computeFragmentSize(const MCAsmLayout &Layout, return cast(F).getContents().size(); } - assert(0 && "invalid fragment kind"); - return 0; + llvm_unreachable("invalid fragment kind"); } void MCAsmLayout::LayoutFragment(MCFragment *F) { @@ -414,8 +413,7 @@ static void WriteFragmentData(const MCAssembler &Asm, const MCAsmLayout &Layout, // Otherwise, write out in multiples of the value size. for (uint64_t i = 0; i != Count; ++i) { switch (AF.getValueSize()) { - default: - assert(0 && "Invalid size!"); + default: llvm_unreachable("Invalid size!"); case 1: OW->Write8 (uint8_t (AF.getValue())); break; case 2: OW->Write16(uint16_t(AF.getValue())); break; case 4: OW->Write32(uint32_t(AF.getValue())); break; @@ -439,8 +437,7 @@ static void WriteFragmentData(const MCAssembler &Asm, const MCAsmLayout &Layout, for (uint64_t i = 0, e = FF.getSize() / FF.getValueSize(); i != e; ++i) { switch (FF.getValueSize()) { - default: - assert(0 && "Invalid size!"); + 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; @@ -496,8 +493,7 @@ void MCAssembler::writeSectionData(const MCSectionData *SD, for (MCSectionData::const_iterator it = SD->begin(), ie = SD->end(); it != ie; ++it) { switch (it->getKind()) { - default: - assert(0 && "Invalid fragment in virtual section!"); + default: llvm_unreachable("Invalid fragment in virtual section!"); case MCFragment::FT_Data: { // Check that we aren't trying to write a non-zero contents (or fixups) // into a virtual section. This is to support clients which use standard -- cgit v1.2.3