summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-02-07 05:05:23 +0000
committerCraig Topper <craig.topper@gmail.com>2012-02-07 05:05:23 +0000
commita2886c21d9a08d63c324cc61aa91ae0893507a31 (patch)
tree26343892cf0ad93e83448d53dc0448e7ad413412 /llvm/lib/MC/MCAssembler.cpp
parenta767941651945183cc3665173fd850a6b057c018 (diff)
downloadbcm5719-llvm-a2886c21d9a08d63c324cc61aa91ae0893507a31.tar.gz
bcm5719-llvm-a2886c21d9a08d63c324cc61aa91ae0893507a31.zip
Convert assert(0) to llvm_unreachable
llvm-svn: 149967
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp12
1 files changed, 4 insertions, 8 deletions
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<MCDwarfCallFrameFragment>(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
OpenPOWER on IntegriCloud