[llvm] [MC][DecoderEmitter] Fix buuld warning: explicit specialization cannot have a storage class (PR #156375)
    Rahul Joshi via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Sep  1 14:35:50 PDT 2025
    
    
  
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/156375
Drop `static` from `InsnBitWidth` specializations.
>From ac7be1eaf8f6c65f4d6e3e878e110df057daec73 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Mon, 1 Sep 2025 14:33:29 -0700
Subject: [PATCH] [MC][DecoderEmitter] Fix buuld warning: explicit
 specialization cannot have a storage class
---
 .../Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp  | 10 ++++------
 .../Target/RISCV/Disassembler/RISCVDisassembler.cpp    |  6 +++---
 2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
index 80d194afa926be..a0b01537d03c88 100644
--- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
@@ -448,12 +448,10 @@ static DecodeStatus decodeVersionImm(MCInst &Inst, unsigned Imm,
 #include "AMDGPUGenDisassemblerTables.inc"
 
 // Define bitwidths for various types used to instantiate the decoder.
-template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint32_t> = 32;
-template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint64_t> = 64;
-template <>
-static constexpr uint32_t llvm::MCD::InsnBitWidth<std::bitset<96>> = 96;
-template <>
-static constexpr uint32_t llvm::MCD::InsnBitWidth<std::bitset<128>> = 128;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<uint32_t> = 32;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<uint64_t> = 64;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<std::bitset<96>> = 96;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<std::bitset<128>> = 128;
 
 //===----------------------------------------------------------------------===//
 //
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
index c8b89f5192c3dc..395672fe5b68b4 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -702,10 +702,10 @@ static constexpr DecoderListEntry DecoderList32[]{
 };
 
 // Define bitwidths for various types used to instantiate the decoder.
-template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint16_t> = 16;
-template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint32_t> = 32;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<uint16_t> = 16;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<uint32_t> = 32;
 // Use uint64_t to represent 48 bit instructions.
-template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint64_t> = 48;
+template <> constexpr uint32_t llvm::MCD::InsnBitWidth<uint64_t> = 48;
 
 DecodeStatus RISCVDisassembler::getInstruction32(MCInst &MI, uint64_t &Size,
                                                  ArrayRef<uint8_t> Bytes,
    
    
More information about the llvm-commits
mailing list