summaryrefslogtreecommitdiffstats
path: root/disassembler
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-10-09 21:56:44 -0700
committerIan Rogers <irogers@google.com>2014-10-09 22:22:46 -0700
commitfc787ecd91127b2c8458afd94e5148e2ae51a1f5 (patch)
treeef48c0f511ee9bf4ed85607cc4d530bace7e6cae /disassembler
parent8fa8c904f7c783204a1dc9438429391d256658da (diff)
downloadart-fc787ecd91127b2c8458afd94e5148e2ae51a1f5.zip
art-fc787ecd91127b2c8458afd94e5148e2ae51a1f5.tar.gz
art-fc787ecd91127b2c8458afd94e5148e2ae51a1f5.tar.bz2
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
Diffstat (limited to 'disassembler')
-rw-r--r--disassembler/disassembler_arm.cc11
-rw-r--r--disassembler/disassembler_x86.cc2
2 files changed, 7 insertions, 6 deletions
diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc
index 6f8e08b..ac883fe 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<int64_t>((imm << 32) | imm);
- case 5: imm <<= 8; // Fall through.
+ case 5: imm <<= 8; FALLTHROUGH_INTENDED;
case 4: return static_cast<int64_t>((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;
}
diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc
index 195c45f..63a74c7 100644
--- a/disassembler/disassembler_x86.cc
+++ b/disassembler/disassembler_x86.cc
@@ -412,7 +412,7 @@ DISASSEMBLER_ENTRY(cmp,
break;
case 0x2E:
opcode << "u";
- // FALLTHROUGH
+ FALLTHROUGH_INTENDED;
case 0x2F:
if (prefix[2] == 0x66) {
opcode << "comisd";