Support: Introduce LLVM_FALLTHROUGH macro.

llvm-svn: 237766
This commit is contained in:
Peter Collingbourne 2015-05-20 02:44:14 +00:00
parent 665bc9c936
commit b0c5df902e
1 changed files with 12 additions and 0 deletions

View File

@ -29,6 +29,10 @@
# define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
# define __has_cpp_attribute(x) 0
#endif
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
@ -401,4 +405,12 @@
#define LLVM_THREAD_LOCAL
#endif
/// \macro LLVM_FALLTHROUGH
/// \brief Marks an empty statement preceding a deliberate switch fallthrough.
#if __has_cpp_attribute(clang::fallthrough)
#define LLVM_FALLTHROUGH [[clang::fallthrough]]
#else
#define LLVM_FALLTHROUGH
#endif
#endif