[clang] c1796be - Don't rely in llvm::Bitset CTAD. NFC.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 08:04:59 PDT 2023


Author: Benjamin Kramer
Date: 2023-09-12T17:04:03+02:00
New Revision: c1796be93fe5e7a5fd672def6f36d6d5062ee559

URL: https://github.com/llvm/llvm-project/commit/c1796be93fe5e7a5fd672def6f36d6d5062ee559
DIFF: https://github.com/llvm/llvm-project/commit/c1796be93fe5e7a5fd672def6f36d6d5062ee559.diff

LOG: Don't rely in llvm::Bitset CTAD. NFC.

This triggers a lot of -Wctad-maybe-unsupported

Added: 
    

Modified: 
    clang/lib/Basic/Targets/AArch64.cpp
    clang/lib/Driver/ToolChains/Arch/AArch64.cpp
    llvm/include/llvm/TargetParser/AArch64TargetParser.h
    llvm/unittests/TargetParser/TargetParserTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index cccdf0e3861d0da..fe5a7af97b7753c 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -979,7 +979,7 @@ bool AArch64TargetInfo::initFeatureMap(
   // Parse the CPU and add any implied features.
   std::optional<llvm::AArch64::CpuInfo> CpuInfo = llvm::AArch64::parseCpu(CPU);
   if (CpuInfo) {
-    llvm::Bitset Exts = CpuInfo->getImpliedExtensions();
+    auto Exts = CpuInfo->getImpliedExtensions();
     std::vector<StringRef> CPUFeats;
     llvm::AArch64::getExtensionFeatures(Exts, CPUFeats);
     for (auto F : CPUFeats) {

diff  --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 19d454dd8bf3643..276984f96d57a51 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -158,7 +158,7 @@ static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU,
 
     Features.push_back(ArchInfo->ArchFeature);
 
-    llvm::Bitset Extension = CpuInfo->getImpliedExtensions();
+    auto Extension = CpuInfo->getImpliedExtensions();
     if (!llvm::AArch64::getExtensionFeatures(Extension, Features))
       return false;
   }

diff  --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 44987da8276a371..190f482044083c0 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -347,7 +347,7 @@ inline constexpr ArchInfo ARMV9_3A  = { VersionTuple{9, 3}, AProfile, "armv9.3-a
 inline constexpr ArchInfo ARMV9_4A  = { VersionTuple{9, 4}, AProfile, "armv9.4-a", "+v9.4a", (ARMV9_3A.DefaultExts |
                                         AArch64::ExtensionBitset({AArch64::AEK_SPECRES2, AArch64::AEK_CSSC, AArch64::AEK_RASv2}))};
 // For v8-R, we do not enable crypto and align with GCC that enables a more minimal set of optional architecture extensions.
-inline constexpr ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", (Bitset(ARMV8_5A.DefaultExts) |
+inline constexpr ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", (ARMV8_5A.DefaultExts |
                                         AArch64::ExtensionBitset({AArch64::AEK_SSBS,
                                         AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SB}).flip(AArch64::AEK_LSE))};
 // clang-format on

diff  --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index 0c114d1b85a6935..d551eb985d37380 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -216,7 +216,7 @@ INSTANTIATE_TEST_SUITE_P(
         ARMCPUTestParams<uint64_t>("arm1020t", "armv5t", "none", ARM::AEK_NONE, "5T"),
         ARMCPUTestParams<uint64_t>("arm9e", "armv5te", "none",
                                    ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm946e-s", "armv5te", "none",
+        ARMCPUTestParams<uint64_t>("arm946e-s", "armv5te", "none",
                                    ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm966e-s", "armv5te", "none",
                                    ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
@@ -1015,7 +1015,7 @@ class AArch64CPUTestFixture
           ARMCPUTestParams<AArch64::ExtensionBitset>> {};
 
 TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
-  ARMCPUTestParams params = GetParam();
+  auto params = GetParam();
 
   const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
   EXPECT_TRUE(Cpu);


        


More information about the cfe-commits mailing list