assert(0) -> LLVM_UNREACHABLE.
[oota-llvm.git] / lib / Transforms / IPO / MergeFunctions.cpp
index 9d87403bdc5a0ea4b4cb89e7a6d4244d377af328..31e36d8994cc6a8cfd0ee8f38241c9b8b404e622 100644 (file)
@@ -53,6 +53,7 @@
 #include "llvm/Support/CallSite.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
 #include <map>
 #include <vector>
 using namespace llvm;
@@ -128,7 +129,7 @@ static bool isEquivalentType(const Type *Ty1, const Type *Ty2) {
     return false;
 
   default:
-    assert(0 && "Unknown type!");
+    LLVM_UNREACHABLE("Unknown type!");
     return false;
 
   case Type::PointerTyID: {
@@ -469,7 +470,7 @@ static LinkageCategory categorize(const Function *F) {
     return ExternalStrong;
   }
 
-  assert(0 && "Unknown LinkageType.");
+  LLVM_UNREACHABLE("Unknown LinkageType.");
   return ExternalWeak;
 }
 
@@ -575,7 +576,7 @@ static bool fold(std::vector<Function *> &FnVec, unsigned i, unsigned j) {
     case Internal:
       switch (catG) {
         case ExternalStrong:
-          assert(0);
+          llvm_unreachable();
           // fall-through
         case ExternalWeak:
          if (F->hasAddressTaken())