[llvm-commits] [llvm] r167936 - /llvm/trunk/lib/Object/Archive.cpp

Matt Beaumont-Gay matthewbg at google.com
Wed Nov 14 09:58:11 PST 2012


Author: matthewbg
Date: Wed Nov 14 11:58:11 2012
New Revision: 167936

URL: http://llvm.org/viewvc/llvm-project?rev=167936&view=rev
Log:
s/assert/llvm_unreachable/

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

Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=167936&r1=167935&r2=167936&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Wed Nov 14 11:58:11 2012
@@ -13,6 +13,7 @@
 
 #include "llvm/Object/Archive.h"
 #include "llvm/ADT/APInt.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/MemoryBuffer.h"
 
@@ -272,7 +273,7 @@
     Offset = *(reinterpret_cast<const support::ubig32_t*>(Offsets)
                + SymbolIndex);
   } else if (Parent->kind() == K_BSD) {
-    assert(0 && "BSD format is not supported");
+    llvm_unreachable("BSD format is not supported");
   } else {
     uint32_t MemberCount = *reinterpret_cast<const support::ulittle32_t*>(Buf);
     
@@ -327,7 +328,7 @@
     symbol_count = *reinterpret_cast<const support::ubig32_t*>(buf);
     buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t)));
   } else if (kind() == K_BSD) {
-    assert(0 && "BSD archive format is not supported");
+    llvm_unreachable("BSD archive format is not supported");
   } else {
     uint32_t member_count = 0;
     uint32_t symbol_count = 0;
@@ -348,7 +349,7 @@
     symbol_count = *reinterpret_cast<const support::ubig32_t*>(buf);
     buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t)));
   } else if (kind() == K_BSD) {
-    assert(0 && "BSD archive format is not supported");
+    llvm_unreachable("BSD archive format is not supported");
   } else {
     uint32_t member_count = 0;
     member_count = *reinterpret_cast<const support::ulittle32_t*>(buf);





More information about the llvm-commits mailing list