From fc787ecd91127b2c8458afd94e5148e2ae51a1f5 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Thu, 9 Oct 2014 21:56:44 -0700 Subject: 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 --- disassembler/disassembler_arm.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'disassembler/disassembler_arm.cc') diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc index 6f8e08b3ba..ac883fe4e3 100644 --- a/disassembler/disassembler_arm.cc +++ b/disassembler/disassembler_arm.cc @@ -407,11 +407,11 @@ uint64_t AdvSIMDExpand(uint32_t op, uint32_t cmode, uint32_t imm8) { } uint64_t imm = imm8; switch (cmode321) { - case 3: imm <<= 8; // Fall through. - case 2: imm <<= 8; // Fall through. - case 1: imm <<= 8; // Fall through. + case 3: imm <<= 8; FALLTHROUGH_INTENDED; + case 2: imm <<= 8; FALLTHROUGH_INTENDED; + case 1: imm <<= 8; FALLTHROUGH_INTENDED; case 0: return static_cast((imm << 32) | imm); - case 5: imm <<= 8; // Fall through. + case 5: imm <<= 8; FALLTHROUGH_INTENDED; case 4: return static_cast((imm << 48) | (imm << 32) | (imm << 16) | imm); case 6: imm = ((imm + 1u) << ((cmode & 1) != 0 ? 16 : 8)) - 1u; // Add 8 or 16 ones. @@ -1196,7 +1196,7 @@ size_t DisassemblerArm::DumpThumb32(std::ostream& os, const uint8_t* instr_ptr) } break; } - // Else deliberate fall-through to B. + FALLTHROUGH_INTENDED; // Else deliberate fall-through to B. case 1: case 3: { // B // |111|11|1|0000|000000|11|1 |1|1 |10000000000| @@ -1597,6 +1597,7 @@ size_t DisassemblerArm::DumpThumb32(std::ostream& os, const uint8_t* instr_ptr) } } } + break; default: break; } -- cgit v1.2.3-59-g8ed1b