[llvm] r295865 - Move llvm_unreachable out of switch.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 11:42:15 PST 2017


Author: rafael
Date: Wed Feb 22 13:42:14 2017
New Revision: 295865

URL: http://llvm.org/viewvc/llvm-project?rev=295865&view=rev
Log:
Move llvm_unreachable out of switch.

This should make gcc happy and still produce a clang warning if we add
another value to the enum.

Modified:
    llvm/trunk/lib/Object/ArchiveWriter.cpp

Modified: llvm/trunk/lib/Object/ArchiveWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ArchiveWriter.cpp?rev=295865&r1=295864&r2=295865&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ArchiveWriter.cpp (original)
+++ llvm/trunk/lib/Object/ArchiveWriter.cpp Wed Feb 22 13:42:14 2017
@@ -129,9 +129,12 @@ static bool isBSDLike(object::Archive::K
   case object::Archive::K_BSD:
   case object::Archive::K_DARWIN:
     return true;
-  default:
-    llvm_unreachable("not supported for writting");
+  case object::Archive::K_MIPS64:
+  case object::Archive::K_DARWIN64:
+  case object::Archive::K_COFF:
+    break;
   }
+  llvm_unreachable("not supported for writting");
 }
 
 static void print32(raw_ostream &Out, object::Archive::Kind Kind,




More information about the llvm-commits mailing list