aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartyn Capewell <martyn.capewell@arm.com>2018-02-06 16:46:34 +0000
committerPierre Langlois <pierre.langlois@arm.com>2018-02-06 16:47:32 +0000
commitde326f850f736c3a337fda52845ed3d2e620cc02 (patch)
tree8ce4777a13c673c977ee764f0215d15b71245e4e
parent0b21ec170aaa8c353e97a68060f784cde9c1eaa8 (diff)
Fix fall-through annotation for GCC 7
GCC 7 enables switch/case fallthrough checking, but this fails in VIXL, because the annotation we use is Clang specific. Also, fix a missing annotation in the disassembler. Change-Id: Iaca23c6c7e95cf9f99d5afeb7490420173f7c037
-rw-r--r--src/aarch64/disasm-aarch64.cc4
-rw-r--r--src/globals-vixl.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/aarch64/disasm-aarch64.cc b/src/aarch64/disasm-aarch64.cc
index ec84dfa0..c6d7a8e6 100644
--- a/src/aarch64/disasm-aarch64.cc
+++ b/src/aarch64/disasm-aarch64.cc
@@ -4392,6 +4392,10 @@ int Disassembler::SubstituteImmediateField(const Instruction *instr,
}
return 3;
}
+ default: {
+ VIXL_UNIMPLEMENTED();
+ return 0;
+ }
}
}
case 'C': { // ICondB - Immediate Conditional Branch.
diff --git a/src/globals-vixl.h b/src/globals-vixl.h
index 62bba4ed..a1801c3f 100644
--- a/src/globals-vixl.h
+++ b/src/globals-vixl.h
@@ -204,10 +204,12 @@ inline void USE(const T1&, const T2&, const T3&, const T4&) {}
#define __has_warning(x) 0
#endif
-// Note: This option is only available for Clang. And will only be enabled for
-// C++11(201103L).
+// Fallthrough annotation for Clang and C++11(201103L).
#if __has_warning("-Wimplicit-fallthrough") && __cplusplus >= 201103L
#define VIXL_FALLTHROUGH() [[clang::fallthrough]]
+// Fallthrough annotation for GCC >= 7.
+#elif __GNUC__ == 7
+#define VIXL_FALLTHROUGH() __attribute__((fallthrough));
#else
#define VIXL_FALLTHROUGH() \
do { \