r181197 - Add llvm_unreachable at end of fully covered switch

Hans Wennborg hans at hanshq.net
Mon May 6 08:13:35 PDT 2013


Author: hans
Date: Mon May  6 10:13:34 2013
New Revision: 181197

URL: http://llvm.org/viewvc/llvm-project?rev=181197&view=rev
Log:
Add llvm_unreachable at end of fully covered switch

To pacify GCC warning about control reaching end of non-void function.

Modified:
    cfe/trunk/lib/AST/ExprConstant.cpp

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=181197&r1=181196&r2=181197&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Mon May  6 10:13:34 2013
@@ -2514,6 +2514,7 @@ static EvalStmtResult EvaluateLoopBody(A
   case ESR_Returned:
     return ESR;
   }
+  llvm_unreachable("Invalid EvalStmtResult!");
 }
 
 // Evaluate a statement.





More information about the cfe-commits mailing list