summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-01 20:03:30 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-01 20:06:38 -0800
commitbb6f33c9f19581e2ea60b46653bb1a10ced4a2eb (patch)
tree8b71ec66292b221e25f0fc00f4e5f91068322696 /src/asm2wasm.h
parentd96c63dc0e6b0a9ccf0c327d8c6c0cb61f95d57f (diff)
downloadbinaryen-bb6f33c9f19581e2ea60b46653bb1a10ced4a2eb.tar.gz
binaryen-bb6f33c9f19581e2ea60b46653bb1a10ced4a2eb.tar.bz2
binaryen-bb6f33c9f19581e2ea60b46653bb1a10ced4a2eb.zip
avoid some warnings
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 3aef520c3..2bb76610b 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -190,16 +190,20 @@ private:
case ASM_INT: return WasmType::i32;
case ASM_DOUBLE: return WasmType::f64;
case ASM_NONE: return WasmType::none;
- default: abort_on("confused asmType", asmType);
+ default: {}
}
+ abort_on("confused asmType", asmType);
+ return (WasmType)-1; // avoid warning
}
AsmType wasmToAsmType(WasmType type) {
switch (type) {
case WasmType::i32: return ASM_INT;
case WasmType::f64: return ASM_DOUBLE;
case WasmType::none: return ASM_NONE;
- default: abort_on("confused wasmType", type);
+ default: {}
}
+ abort_on("confused wasmType", type);
+ return (AsmType)-1; // avoid warning
}
AsmType detectAsmType(Ref ast, AsmData *data) {
@@ -284,6 +288,7 @@ private:
{ relational = RelationalOp::Lt; return false; }
}
abort_on("bad wasm binary op", op);
+ return false; // avoid warning
}
unsigned bytesToShift(unsigned bytes) {
@@ -292,8 +297,10 @@ private:
case 2: return 1;
case 4: return 2;
case 8: return 3;
- default: abort();
+ default: {}
}
+ abort();
+ return -1; // avoid warning
}
wasm::Arena tempAllocator;
@@ -979,6 +986,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
#endif
}
abort_on("confusing expression", ast);
+ return (Expression*)nullptr; // avoid warning
};
// given HEAP32[addr >> 2], we need an absolute address, and would like to remove that shift.
@@ -997,6 +1005,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
return (Expression*)ret;
}
abort_on("bad processUnshifted", ptr);
+ return (Expression*)nullptr; // avoid warning
};
processStatements = [&](Ref ast, unsigned from) -> Expression* {