Enable -Wimplicit-fallthrough.
Falling through switch cases on a clang build must now annotate the fallthrough
with the FALLTHROUGH_INTENDED macro.
Bug: 17731372
Change-Id: I836451cd5f96b01d1ababdbf9eef677fe8fa8324
diff --git a/runtime/dex_instruction-inl.h b/runtime/dex_instruction-inl.h
index ad9491f..dd65f2c 100644
--- a/runtime/dex_instruction-inl.h
+++ b/runtime/dex_instruction-inl.h
@@ -460,11 +460,21 @@
* copies of those.) Note that cases 5..2 fall through.
*/
switch (count) {
- case 5: arg[4] = InstA(inst_data);
- case 4: arg[3] = (regList >> 12) & 0x0f;
- case 3: arg[2] = (regList >> 8) & 0x0f;
- case 2: arg[1] = (regList >> 4) & 0x0f;
- case 1: arg[0] = regList & 0x0f; break;
+ case 5:
+ arg[4] = InstA(inst_data);
+ FALLTHROUGH_INTENDED;
+ case 4:
+ arg[3] = (regList >> 12) & 0x0f;
+ FALLTHROUGH_INTENDED;
+ case 3:
+ arg[2] = (regList >> 8) & 0x0f;
+ FALLTHROUGH_INTENDED;
+ case 2:
+ arg[1] = (regList >> 4) & 0x0f;
+ FALLTHROUGH_INTENDED;
+ case 1:
+ arg[0] = regList & 0x0f;
+ break;
default: // case 0
break; // Valid, but no need to do anything.
}