Remove `else` or `break` after `fatal`. NFC.

fatal() does not return, so we don't need `else` or `break` after a call
of fatal.

llvm-svn: 319355
This commit is contained in:
Rui Ueyama 2017-11-29 20:45:58 +00:00
parent 580c102ab8
commit e48f223ed6
2 changed files with 8 additions and 13 deletions

View File

@ -602,17 +602,15 @@ void Writer::calculateOffsets() {
// Elem
uint32_t SegmentCount = WasmFile->elements().size();
if (SegmentCount) {
if (SegmentCount > 1) {
if (SegmentCount > 1)
fatal(File->getName() + ": contains more than element segment");
} else {
const WasmElemSegment &Segment = WasmFile->elements()[0];
if (Segment.TableIndex != 0)
fatal(File->getName() + ": unsupported table index");
else if (Segment.Offset.Value.Int32 != 0)
fatal(File->getName() + ": unsupported segment offset");
else
NumElements += Segment.Functions.size();
}
const WasmElemSegment &Segment = WasmFile->elements()[0];
if (Segment.TableIndex != 0)
fatal(File->getName() + ": unsupported table index");
if (Segment.Offset.Value.Int32 != 0)
fatal(File->getName() + ": unsupported segment offset");
NumElements += Segment.Functions.size();
}
}
}

View File

@ -112,7 +112,6 @@ void wasm::writeInitExpr(raw_ostream &OS, const WasmInitExpr &InitExpr) {
break;
default:
fatal("unknown opcode in init expr: " + Twine(InitExpr.Opcode));
break;
}
writeU8(OS, WASM_OPCODE_END, "opcode:end");
}
@ -147,7 +146,6 @@ void wasm::writeImport(raw_ostream &OS, const WasmImport &Import) {
break;
default:
fatal("unsupported import type: " + Twine(Import.Kind));
break;
}
}
@ -166,7 +164,6 @@ void wasm::writeExport(raw_ostream &OS, const WasmExport &Export) {
break;
default:
fatal("unsupported export type: " + Twine(Export.Kind));
break;
}
}