[C++] Use 'nullptr'. Transforms edition.
[oota-llvm.git] / lib / Transforms / Utils / CmpInstAnalysis.cpp
index 8983e0c4f05785de55ac79a48e59795934b1a5dd..3b15a0a3e60afdfbcb987fbd2634652ff205a636 100644 (file)
@@ -13,8 +13,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Utils/CmpInstAnalysis.h"
-#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Instructions.h"
 
 using namespace llvm;
 
@@ -72,7 +72,7 @@ unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) {
 Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS,
                           CmpInst::Predicate &NewICmpPred) {
   switch (Code) {
-    default: assert(0 && "Illegal ICmp code!");
+    default: llvm_unreachable("Illegal ICmp code!");
     case 0: // False.
       return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 0);
     case 1: NewICmpPred = Sign ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; break;
@@ -84,7 +84,7 @@ Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS,
     case 7: // True.
       return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 1);
   }
-  return NULL;
+  return nullptr;
 }
 
 /// PredicatesFoldable - Return true if both predicates match sign or if at