diff options
author | Ian Rogers <irogers@google.com> | 2014-10-09 21:56:44 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-10-09 22:22:46 -0700 |
commit | fc787ecd91127b2c8458afd94e5148e2ae51a1f5 (patch) | |
tree | ef48c0f511ee9bf4ed85607cc4d530bace7e6cae /compiler/dex/quick/arm/int_arm.cc | |
parent | 8fa8c904f7c783204a1dc9438429391d256658da (diff) |
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 'compiler/dex/quick/arm/int_arm.cc')
-rw-r--r-- | compiler/dex/quick/arm/int_arm.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/dex/quick/arm/int_arm.cc b/compiler/dex/quick/arm/int_arm.cc index 8f1261d301..018dc1c0c6 100644 --- a/compiler/dex/quick/arm/int_arm.cc +++ b/compiler/dex/quick/arm/int_arm.cc @@ -49,12 +49,13 @@ LIR* ArmMir2Lir::OpIT(ConditionCode ccode, const char* guide) { int cond_bit = code & 1; int alt_bit = cond_bit ^ 1; - // Note: case fallthroughs intentional switch (strlen(guide)) { case 3: mask1 = (guide[2] == 'T') ? cond_bit : alt_bit; + FALLTHROUGH_INTENDED; case 2: mask2 = (guide[1] == 'T') ? cond_bit : alt_bit; + FALLTHROUGH_INTENDED; case 1: mask3 = (guide[0] == 'T') ? cond_bit : alt_bit; break; @@ -62,6 +63,7 @@ LIR* ArmMir2Lir::OpIT(ConditionCode ccode, const char* guide) { break; default: LOG(FATAL) << "OAT: bad case in OpIT"; + UNREACHABLE(); } mask = (mask3 << 3) | (mask2 << 2) | (mask1 << 1) | (1 << (3 - strlen(guide))); @@ -77,12 +79,13 @@ void ArmMir2Lir::UpdateIT(LIR* it, const char* new_guide) { int cond_bit = code & 1; int alt_bit = cond_bit ^ 1; - // Note: case fallthroughs intentional switch (strlen(new_guide)) { case 3: mask1 = (new_guide[2] == 'T') ? cond_bit : alt_bit; + FALLTHROUGH_INTENDED; case 2: mask2 = (new_guide[1] == 'T') ? cond_bit : alt_bit; + FALLTHROUGH_INTENDED; case 1: mask3 = (new_guide[0] == 'T') ? cond_bit : alt_bit; break; @@ -90,6 +93,7 @@ void ArmMir2Lir::UpdateIT(LIR* it, const char* new_guide) { break; default: LOG(FATAL) << "OAT: bad case in UpdateIT"; + UNREACHABLE(); } mask = (mask3 << 3) | (mask2 << 2) | (mask1 << 1) | (1 << (3 - strlen(new_guide))); |