llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
[oota-llvm.git] / lib / VMCore / ValueTypes.cpp
index c16d27722e80bb9ea129f8673d099747a0c8b761..6e2917b6e7229706bca53f971a6144c722451c91 100644 (file)
@@ -16,6 +16,7 @@
 #include "llvm/LLVMContext.h"
 #include "llvm/Type.h"
 #include "llvm/DerivedTypes.h"
+#include "llvm/Support/ErrorHandling.h"
 using namespace llvm;
 
 MVT MVT::getExtendedIntegerVT(unsigned BitWidth) {
@@ -90,7 +91,7 @@ std::string MVT::getMVTString() const {
              getVectorElementType().getMVTString();
     if (isInteger())
       return "i" + utostr(getSizeInBits());
-    assert(0 && "Invalid MVT!");
+    llvm_unreachable("Invalid MVT!");
     return "?";
   case MVT::i1:      return "i1";
   case MVT::i8:      return "i8";
@@ -158,8 +159,8 @@ const Type *MVT::getTypeForMVT(LLVMContext &Context) const {
   case MVT::v32i8:   return Context.getVectorType(Type::Int8Ty, 32);
   case MVT::v2i16:   return Context.getVectorType(Type::Int16Ty, 2);
   case MVT::v4i16:   return Context.getVectorType(Type::Int16Ty, 4);
-  case MVT::v8i16:   return Context.getVectorType(Type::Int16Ty, 16);
-  case MVT::v16i16:  return Context.getVectorType(Type::Int16Ty, 8);
+  case MVT::v8i16:   return Context.getVectorType(Type::Int16Ty, 8);
+  case MVT::v16i16:  return Context.getVectorType(Type::Int16Ty, 16);
   case MVT::v2i32:   return Context.getVectorType(Type::Int32Ty, 2);
   case MVT::v3i32:   return Context.getVectorType(Type::Int32Ty, 3);
   case MVT::v4i32:   return Context.getVectorType(Type::Int32Ty, 4);
@@ -183,7 +184,7 @@ MVT MVT::getMVT(const Type *Ty, bool HandleUnknown){
   switch (Ty->getTypeID()) {
   default:
     if (HandleUnknown) return MVT::Other;
-    assert(0 && "Unknown type!");
+    llvm_unreachable("Unknown type!");
     return MVT::isVoid;
   case Type::VoidTyID:
     return MVT::isVoid;
@@ -201,4 +202,4 @@ MVT MVT::getMVT(const Type *Ty, bool HandleUnknown){
                        VTy->getNumElements());
   }
   }
-}
\ No newline at end of file
+}