[PATCH] D33036: [Support/Compiler.h] - Use gnu::fallthrough for LLVM_FALLTHROUGH when available.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 00:06:59 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302878: [Support/Compiler.h] - Use gnu::fallthrough for LLVM_FALLTHROUGH when available. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D33036?vs=98600&id=98729#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33036

Files:
  llvm/trunk/include/llvm/Support/Compiler.h


Index: llvm/trunk/include/llvm/Support/Compiler.h
===================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h
+++ llvm/trunk/include/llvm/Support/Compiler.h
@@ -227,6 +227,8 @@
 /// LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
 #define LLVM_FALLTHROUGH [[fallthrough]]
+#elif __has_cpp_attribute(gnu::fallthrough)
+#define LLVM_FALLTHROUGH [[gnu::fallthrough]]
 #elif !__cplusplus
 // Workaround for llvm.org/PR23435, since clang 3.6 and below emit a spurious
 // error when __has_cpp_attribute is given a scoped attribute in C mode.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33036.98729.patch
Type: text/x-patch
Size: 671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/076f96c9/attachment.bin>


More information about the llvm-commits mailing list