From de37414d10a051bda895b81c7776a6bb006f7ab5 Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Sat, 22 Jun 2024 21:08:06 +0800 Subject: [PATCH] [LoongArch] fix fallthrough attribute build warning Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/IADFRG ``` .../toolchain/llvm-project/llvm/lib/Object/ELFObjectFile.cpp:353:7: warning: use of the 'fallthrough' attribute is a C++17 extension [-Wc++17-attribute-extensions] [[fallthrough]]; ^ 1 warning generated. ``` Signed-off-by: Wu Xiaotian --- clang/lib/Driver/ToolChains/Arch/LoongArch.cpp | 2 +- llvm/lib/Object/ELFObjectFile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp b/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp index 9b7877c88fbf..745c36ded5a6 100644 --- a/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp +++ b/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp @@ -116,7 +116,7 @@ StringRef loongarch::getLoongArchABI(const Driver &D, const ArgList &Args, // shall remain valid or not, so we are going to continue recognizing it // for some time, until it is clear that everyone else has migrated away // from it. - [[fallthrough]]; + LLVM_FALLTHROUGH; case llvm::Triple::GNU: default: return IsLA32 ? "ilp32d" : "lp64d"; diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 5b4380e47386..aa9a39c13765 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -350,7 +350,7 @@ SubtargetFeatures ELFObjectFileBase::getLoongArchFeatures() const { case ELF::EF_LOONGARCH_ABI_DOUBLE_FLOAT: Features.AddFeature("d"); // D implies F according to LoongArch ISA spec. - [[fallthrough]]; + LLVM_FALLTHROUGH; case ELF::EF_LOONGARCH_ABI_SINGLE_FLOAT: Features.AddFeature("f"); break; -- Gitee