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

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 21 23:31:32 PDT 2024


Author: Brandon Wu
Date: 2024-07-22T14:31:28+08:00
New Revision: 2873edd2867c151871f7ec3865819ff0f874c95a

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

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

This prevent the warnings from compiler.

Added: 
    

Modified: 
    lld/ELF/Arch/RISCV.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp
index 6af89ce3517b7..56759c28dcf41 100644
--- a/lld/ELF/Arch/RISCV.cpp
+++ b/lld/ELF/Arch/RISCV.cpp
@@ -1131,6 +1131,7 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
     case RISCVAttrs::RISCVAtomicAbiTag::A6C:
       return;
     };
+    break;
 
   case RISCVAtomicAbiTag::A6S:
     switch (newTag) {
@@ -1144,6 +1145,7 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
     case RISCVAttrs::RISCVAtomicAbiTag::A6S:
       return;
     };
+    break;
 
   case RISCVAtomicAbiTag::A7:
     switch (newTag) {
@@ -1157,6 +1159,7 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
     case RISCVAttrs::RISCVAtomicAbiTag::A7:
       return;
     };
+    break;
   };
 
   // If we get here, then we have an invalid tag, so report it.


        


More information about the llvm-commits mailing list