[flang-commits] [flang] eb05a2e - [Flang] Add fallthrough annotations in visit.h (#90014)
via flang-commits
flang-commits at lists.llvm.org
Thu Apr 25 10:54:33 PDT 2024
Author: Alexander Shaposhnikov
Date: 2024-04-25T10:54:30-07:00
New Revision: eb05a2e89dccec734625aa336b553197b75f2340
URL: https://github.com/llvm/llvm-project/commit/eb05a2e89dccec734625aa336b553197b75f2340
DIFF: https://github.com/llvm/llvm-project/commit/eb05a2e89dccec734625aa336b553197b75f2340.diff
LOG: [Flang] Add fallthrough annotations in visit.h (#90014)
Add fallthrough annotations to avoid warnings if -Wimplicit-fallthrough
is enabled.
Test plan: ninja check-all
Added:
Modified:
flang/include/flang/Common/visit.h
Removed:
################################################################################
diff --git a/flang/include/flang/Common/visit.h b/flang/include/flang/Common/visit.h
index 4d0897301e01db..7fe9ff839917c9 100644
--- a/flang/include/flang/Common/visit.h
+++ b/flang/include/flang/Common/visit.h
@@ -23,6 +23,7 @@
#include "variant.h"
#include "flang/Common/api-attrs.h"
+#include "llvm/Support/Compiler.h"
#include <type_traits>
namespace Fortran::common {
@@ -40,11 +41,17 @@ inline RT_API_ATTRS RESULT Log2VisitHelper(
return visitor(std::get<(LOW + N)>(std::forward<VARIANT>(u))...); \
}
VISIT_CASE_N(1)
+ LLVM_FALLTHROUGH;
VISIT_CASE_N(2)
+ LLVM_FALLTHROUGH;
VISIT_CASE_N(3)
+ LLVM_FALLTHROUGH;
VISIT_CASE_N(4)
+ LLVM_FALLTHROUGH;
VISIT_CASE_N(5)
+ LLVM_FALLTHROUGH;
VISIT_CASE_N(6)
+ LLVM_FALLTHROUGH;
VISIT_CASE_N(7)
#undef VISIT_CASE_N
}
More information about the flang-commits
mailing list