[llvm] 297242a - [InstCombine] Fix -Wimplicit-fallthrough in InstCombinerImpl::visitCallInst (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 07:53:56 PDT 2023


Author: Jie Fu
Date: 2023-03-31T22:52:46+08:00
New Revision: 297242a2bb89089397ee0cc0701c5555194af293

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

LOG: [InstCombine] Fix -Wimplicit-fallthrough in InstCombinerImpl::visitCallInst (NFC)

/data/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:3078:3: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
  default:
  ^
/data/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:3078:3: note: insert 'break;' to avoid fall-through
  default:
  ^
  break;
1 error generated.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 028792895ebd..519fab256bbc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3075,6 +3075,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
       if (auto *Sel = dyn_cast<SelectInst>(Op))
         if (Instruction *R = FoldOpIntoSelect(*II, Sel))
           return R;
+    [[fallthrough]];
   default:
     break;
   }


        


More information about the llvm-commits mailing list