[llvm] r281865 - Fix covered-switch-default warning

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 18 14:08:35 PDT 2016


Author: rksimon
Date: Sun Sep 18 16:08:35 2016
New Revision: 281865

URL: http://llvm.org/viewvc/llvm-project?rev=281865&view=rev
Log:
Fix covered-switch-default warning

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp?rev=281865&r1=281864&r2=281865&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp Sun Sep 18 16:08:35 2016
@@ -983,14 +983,13 @@ void SelectInstVisitor::visitSelectInst(
     return;
   case VM_instrument:
     instrumentOneSelectInst(SI);
-    break;
+    return;
   case VM_annotate:
     annotateOneSelectInst(SI);
-    break;
-  default:
-    llvm_unreachable("Unknown visiting mode");
-    break;
+    return;
   }
+
+  llvm_unreachable("Unknown visiting mode");
 }
 
 // Traverse all the indirect callsites and annotate the instructions.




More information about the llvm-commits mailing list