summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/wasm/Writer.cpp18
-rw-r--r--lld/wasm/WriterUtils.cpp3
2 files changed, 8 insertions, 13 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 301326ba375..fa9c0df6a05 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -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();
}
}
}
diff --git a/lld/wasm/WriterUtils.cpp b/lld/wasm/WriterUtils.cpp
index 882f4498656..e3be081b3ad 100644
--- a/lld/wasm/WriterUtils.cpp
+++ b/lld/wasm/WriterUtils.cpp
@@ -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;
}
}
OpenPOWER on IntegriCloud