[llvm] 0e8fc21 - Fix Clang -Wcovered-switch-default warning by moving llvm_unreachable default to after the switch

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 18:57:06 PDT 2019


Author: David Blaikie
Date: 2019-10-24T18:56:45-07:00
New Revision: 0e8fc21c2ec780297dfd7fd643b171857c45d7a3

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

LOG: Fix Clang -Wcovered-switch-default warning by moving llvm_unreachable default to after the switch

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index f2c2df4879f2..bfb0c0dfb602 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -6607,10 +6607,8 @@ const SCEV *ScalarEvolution::getExitCount(const Loop *L,
     return getBackedgeTakenInfo(L).getExact(ExitingBlock, this);
   case ConstantMaximum:
     return getCouldNotCompute();
-  default:
-    llvm_unreachable("Impossible case!");
   };
-  
+  llvm_unreachable("Invalid ExitCountKind!");
 }
 
 const SCEV *
@@ -6626,9 +6624,8 @@ const SCEV *ScalarEvolution::getBackedgeTakenCount(const Loop *L,
     return getBackedgeTakenInfo(L).getExact(L, this);
   case ConstantMaximum:
     return getBackedgeTakenInfo(L).getMax(this);
-  default:
-    llvm_unreachable("Impossible case!");
   };
+  llvm_unreachable("Invalid ExitCountKind!");
 }
 
 bool ScalarEvolution::isBackedgeTakenCountMaxOrZero(const Loop *L) {


        


More information about the llvm-commits mailing list