[lld] [lld][RISCV] Add break to nested switch in `mergeAtomic` (PR #99762)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 20 08:26:01 PDT 2024


4vtomat wrote:

> The change seems fine, but what compiler is warning about this? lld was compiling without warning for me recently with ToT clang.

The warning is 
```
llvm-project/lld/ELF/Arch/RISCV.cpp: In function ‘void mergeAtomic(llvm::DenseMapBase<llvm::DenseMap<unsigned int, unsigned int>, unsigned int, unsigned int, llvm
::DenseMapInfo<unsigned int>, llvm::detail::DenseMapPair<unsigned int, unsigned int> >::iterator, const lld::elf::InputSectionBase*, const lld::elf::InputSectionBase*, llvm::RISCVA
ttrs::RISCVAtomicAbiTag, llvm::RISCVAttrs::RISCVAtomicAbiTag)’:
llvm-project/lld/ELF/Arch/RISCV.cpp:1123:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
     switch (newTag) {
     ^~~~~~
llvm-project/lld/ELF/Arch/RISCV.cpp:1135:3: note: here
   case RISCVAtomicAbiTag::A6S:
   ^~~~
llvm-project/lld/ELF/Arch/RISCV.cpp:1136:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
     switch (newTag) {
     ^~~~~~
llvm-project/lld/ELF/Arch/RISCV.cpp:1148:3: note: here
   case RISCVAtomicAbiTag::A7:
   ^~~~
```

https://github.com/llvm/llvm-project/pull/99762


More information about the llvm-commits mailing list