llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 1b8db42..398f78a 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -883,7 +883,7 @@
           Value *LV = new LoadInst(InitBool, InitBool->getName()+".val", CI);
           InitBoolUsed = true;
           switch (CI->getPredicate()) {
-          default: LLVM_UNREACHABLE("Unknown ICmp Predicate!");
+          default: llvm_unreachable("Unknown ICmp Predicate!");
           case ICmpInst::ICMP_ULT:
           case ICmpInst::ICMP_SLT:
             LV = Context->getConstantIntFalse();   // X < null -> always false
@@ -1164,7 +1164,7 @@
                             PN->getName()+".f"+utostr(FieldNo), PN);
     PHIsToRewrite.push_back(std::make_pair(PN, FieldNo));
   } else {
-    LLVM_UNREACHABLE("Unknown usable value");
+    llvm_unreachable("Unknown usable value");
     Result = 0;
   }
   
@@ -2057,7 +2057,7 @@
       for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
         Elts.push_back(Context->getUndef(STy->getElementType(i)));
     } else {
-      LLVM_UNREACHABLE("This code is out of sync with "
+      llvm_unreachable("This code is out of sync with "
              " ConstantFoldLoadThroughGEPConstantExpr");
     }
     
@@ -2085,7 +2085,7 @@
       Constant *Elt = Context->getUndef(ATy->getElementType());
       Elts.assign(ATy->getNumElements(), Elt);
     } else {
-      LLVM_UNREACHABLE("This code is out of sync with "
+      llvm_unreachable("This code is out of sync with "
              " ConstantFoldLoadThroughGEPConstantExpr");
     }
     
diff --git a/lib/Transforms/IPO/MergeFunctions.cpp b/lib/Transforms/IPO/MergeFunctions.cpp
index 31e36d8..9cc4daa 100644
--- a/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/lib/Transforms/IPO/MergeFunctions.cpp
@@ -129,7 +129,7 @@
     return false;
 
   default:
-    LLVM_UNREACHABLE("Unknown type!");
+    llvm_unreachable("Unknown type!");
     return false;
 
   case Type::PointerTyID: {
@@ -470,7 +470,7 @@
     return ExternalStrong;
   }
 
-  LLVM_UNREACHABLE("Unknown LinkageType.");
+  llvm_unreachable("Unknown LinkageType.");
   return ExternalWeak;
 }
 
@@ -576,7 +576,7 @@
     case Internal:
       switch (catG) {
         case ExternalStrong:
-          llvm_unreachable();
+          llvm_unreachable(0);
           // fall-through
         case ExternalWeak:
 	  if (F->hasAddressTaken())
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp
index 51a0bae..36b4464 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -408,7 +408,7 @@
     TransCache[v] = v;
     return v;
   }
-  LLVM_UNREACHABLE("Value not handled");
+  llvm_unreachable("Value not handled");
   return 0;
 }
 
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index f0d131c..e7be985 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -202,7 +202,7 @@
 Expression::ExpressionOpcode ValueTable::getOpcode(BinaryOperator* BO) {
   switch(BO->getOpcode()) {
   default: // THIS SHOULD NEVER HAPPEN
-    LLVM_UNREACHABLE("Binary operator with unknown opcode?");
+    llvm_unreachable("Binary operator with unknown opcode?");
   case Instruction::Add:  return Expression::ADD;
   case Instruction::FAdd: return Expression::FADD;
   case Instruction::Sub:  return Expression::SUB;
@@ -228,7 +228,7 @@
   if (isa<ICmpInst>(C)) {
     switch (C->getPredicate()) {
     default:  // THIS SHOULD NEVER HAPPEN
-      LLVM_UNREACHABLE("Comparison with unknown predicate?");
+      llvm_unreachable("Comparison with unknown predicate?");
     case ICmpInst::ICMP_EQ:  return Expression::ICMPEQ;
     case ICmpInst::ICMP_NE:  return Expression::ICMPNE;
     case ICmpInst::ICMP_UGT: return Expression::ICMPUGT;
@@ -243,7 +243,7 @@
   } else {
     switch (C->getPredicate()) {
     default: // THIS SHOULD NEVER HAPPEN
-      LLVM_UNREACHABLE("Comparison with unknown predicate?");
+      llvm_unreachable("Comparison with unknown predicate?");
     case FCmpInst::FCMP_OEQ: return Expression::FCMPOEQ;
     case FCmpInst::FCMP_OGT: return Expression::FCMPOGT;
     case FCmpInst::FCMP_OGE: return Expression::FCMPOGE;
@@ -265,7 +265,7 @@
 Expression::ExpressionOpcode ValueTable::getOpcode(CastInst* C) {
   switch(C->getOpcode()) {
   default: // THIS SHOULD NEVER HAPPEN
-    LLVM_UNREACHABLE("Cast operator with unknown opcode?");
+    llvm_unreachable("Cast operator with unknown opcode?");
   case Instruction::Trunc:    return Expression::TRUNC;
   case Instruction::ZExt:     return Expression::ZEXT;
   case Instruction::SExt:     return Expression::SEXT;
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp
index d5098f2..3f66131 100644
--- a/lib/Transforms/Scalar/GVNPRE.cpp
+++ b/lib/Transforms/Scalar/GVNPRE.cpp
@@ -241,7 +241,7 @@
     
     // THIS SHOULD NEVER HAPPEN
     default:
-      LLVM_UNREACHABLE("Binary operator with unknown opcode?");
+      llvm_unreachable("Binary operator with unknown opcode?");
       return Expression::ADD;
   }
 }
@@ -272,7 +272,7 @@
       
       // THIS SHOULD NEVER HAPPEN
       default:
-        LLVM_UNREACHABLE("Comparison with unknown predicate?");
+        llvm_unreachable("Comparison with unknown predicate?");
         return Expression::ICMPEQ;
     }
   } else {
@@ -308,7 +308,7 @@
       
       // THIS SHOULD NEVER HAPPEN
       default:
-        LLVM_UNREACHABLE("Comparison with unknown predicate?");
+        llvm_unreachable("Comparison with unknown predicate?");
         return Expression::FCMPOEQ;
     }
   }
@@ -344,7 +344,7 @@
     
     // THIS SHOULD NEVER HAPPEN
     default:
-      LLVM_UNREACHABLE("Cast operator with unknown opcode?");
+      llvm_unreachable("Cast operator with unknown opcode?");
       return Expression::BITCAST;
   }
 }
@@ -578,7 +578,7 @@
   if (VI != valueNumbering.end())
     return VI->second;
   else
-    LLVM_UNREACHABLE("Value not numbered?");
+    llvm_unreachable("Value not numbered?");
   
   return 0;
 }
@@ -768,7 +768,7 @@
     if (v == VN.lookup(*I))
       return *I;
   
-  LLVM_UNREACHABLE("No leader found, but present bit is set?");
+  llvm_unreachable("No leader found, but present bit is set?");
   return 0;
 }
 
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 864b2fa..f42827c 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -1682,7 +1682,7 @@
     
     UndefElts = UndefElts2;
     if (VWidth > InVWidth) {
-      LLVM_UNREACHABLE("Unimp");
+      llvm_unreachable("Unimp");
       // If there are more elements in the result than there are in the source,
       // then an output element is undef if the corresponding input element is
       // undef.
@@ -1690,7 +1690,7 @@
         if (UndefElts2[OutIdx/Ratio])
           UndefElts.set(OutIdx);
     } else if (VWidth < InVWidth) {
-      LLVM_UNREACHABLE("Unimp");
+      llvm_unreachable("Unimp");
       // If there are more elements in the source than there are in the result,
       // then a result element is undef if all of the corresponding input
       // elements are undef.
@@ -1760,7 +1760,7 @@
           RHS = InsertNewInstBefore(new ExtractElementInst(RHS, 0U,"tmp"), *II);
           
           switch (II->getIntrinsicID()) {
-          default: LLVM_UNREACHABLE("Case stmts out of sync!");
+          default: llvm_unreachable("Case stmts out of sync!");
           case Intrinsic::x86_sse_sub_ss:
           case Intrinsic::x86_sse2_sub_sd:
             TmpV = InsertNewInstBefore(BinaryOperator::CreateFSub(LHS, RHS,
@@ -1931,7 +1931,7 @@
     New = CmpInst::Create(*Context, CI->getOpcode(), CI->getPredicate(),
                           Op0, Op1, SO->getName()+".cmp");
   else {
-    LLVM_UNREACHABLE("Unknown binary instruction type!");
+    llvm_unreachable("Unknown binary instruction type!");
   }
   return IC->InsertNewInstBefore(New, I);
 }
@@ -2022,7 +2022,7 @@
                                 PN->getIncomingValue(i), C, "phitmp",
                                 NonConstBB->getTerminator());
         else
-          LLVM_UNREACHABLE("Unknown binop!");
+          llvm_unreachable("Unknown binop!");
         
         AddToWorkList(cast<Instruction>(InV));
       }
@@ -3367,7 +3367,7 @@
   case ICmpInst::ICMP_SLE: return 6;  // 110
     // True -> 7
   default:
-    LLVM_UNREACHABLE("Invalid ICmp predicate!");
+    llvm_unreachable("Invalid ICmp predicate!");
     return 0;
   }
 }
@@ -3395,7 +3395,7 @@
     // True -> 7
   default:
     // Not expecting FCMP_FALSE and FCMP_TRUE;
-    LLVM_UNREACHABLE("Unexpected FCmp predicate!");
+    llvm_unreachable("Unexpected FCmp predicate!");
     return 0;
   }
 }
@@ -3407,7 +3407,7 @@
 static Value *getICmpValue(bool sign, unsigned code, Value *LHS, Value *RHS,
                            LLVMContext *Context) {
   switch (code) {
-  default: LLVM_UNREACHABLE("Illegal ICmp code!");
+  default: llvm_unreachable("Illegal ICmp code!");
   case  0: return Context->getConstantIntFalse();
   case  1: 
     if (sign)
@@ -3441,7 +3441,7 @@
 static Value *getFCmpValue(bool isordered, unsigned code,
                            Value *LHS, Value *RHS, LLVMContext *Context) {
   switch (code) {
-  default: LLVM_UNREACHABLE("Illegal FCmp code!");
+  default: llvm_unreachable("Illegal FCmp code!");
   case  0:
     if (isordered)
       return new FCmpInst(*Context, FCmpInst::FCMP_ORD, LHS, RHS);
@@ -3520,7 +3520,7 @@
     case Instruction::And: Code = LHSCode & RHSCode; break;
     case Instruction::Or:  Code = LHSCode | RHSCode; break;
     case Instruction::Xor: Code = LHSCode ^ RHSCode; break;
-    default: LLVM_UNREACHABLE("Illegal logical opcode!"); return 0;
+    default: llvm_unreachable("Illegal logical opcode!"); return 0;
     }
 
     bool isSigned = ICmpInst::isSignedPredicate(RHSICI->getPredicate()) || 
@@ -3855,10 +3855,10 @@
   assert(LHSCst != RHSCst && "Compares not folded above?");
 
   switch (LHSCC) {
-  default: LLVM_UNREACHABLE("Unknown integer condition code!");
+  default: llvm_unreachable("Unknown integer condition code!");
   case ICmpInst::ICMP_EQ:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X == 13 & X == 15) -> false
     case ICmpInst::ICMP_UGT:        // (X == 13 & X >  15) -> false
     case ICmpInst::ICMP_SGT:        // (X == 13 & X >  15) -> false
@@ -3870,7 +3870,7 @@
     }
   case ICmpInst::ICMP_NE:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_ULT:
       if (LHSCst == SubOne(RHSCst, Context)) // (X != 13 & X u< 14) -> X < 13
         return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Val, LHSCst);
@@ -3897,7 +3897,7 @@
     break;
   case ICmpInst::ICMP_ULT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X u< 13 & X == 15) -> false
     case ICmpInst::ICMP_UGT:        // (X u< 13 & X u> 15) -> false
       return ReplaceInstUsesWith(I, Context->getConstantIntFalse());
@@ -3912,7 +3912,7 @@
     break;
   case ICmpInst::ICMP_SLT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X s< 13 & X == 15) -> false
     case ICmpInst::ICMP_SGT:        // (X s< 13 & X s> 15) -> false
       return ReplaceInstUsesWith(I, Context->getConstantIntFalse());
@@ -3927,7 +3927,7 @@
     break;
   case ICmpInst::ICMP_UGT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X u> 13 & X == 15) -> X == 15
     case ICmpInst::ICMP_UGT:        // (X u> 13 & X u> 15) -> X u> 15
       return ReplaceInstUsesWith(I, RHS);
@@ -3946,7 +3946,7 @@
     break;
   case ICmpInst::ICMP_SGT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X s> 13 & X == 15) -> X == 15
     case ICmpInst::ICMP_SGT:        // (X s> 13 & X s> 15) -> X s> 15
       return ReplaceInstUsesWith(I, RHS);
@@ -4544,10 +4544,10 @@
   assert(LHSCst != RHSCst && "Compares not folded above?");
 
   switch (LHSCC) {
-  default: LLVM_UNREACHABLE("Unknown integer condition code!");
+  default: llvm_unreachable("Unknown integer condition code!");
   case ICmpInst::ICMP_EQ:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:
       if (LHSCst == SubOne(RHSCst, Context)) {
         // (X == 13 | X == 14) -> X-13 <u 2
@@ -4570,7 +4570,7 @@
     break;
   case ICmpInst::ICMP_NE:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:          // (X != 13 | X == 15) -> X != 13
     case ICmpInst::ICMP_UGT:         // (X != 13 | X u> 15) -> X != 13
     case ICmpInst::ICMP_SGT:         // (X != 13 | X s> 15) -> X != 13
@@ -4583,7 +4583,7 @@
     break;
   case ICmpInst::ICMP_ULT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X u< 13 | X == 14) -> no change
       break;
     case ICmpInst::ICMP_UGT:        // (X u< 13 | X u> 15) -> (X-13) u> 2
@@ -4604,7 +4604,7 @@
     break;
   case ICmpInst::ICMP_SLT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X s< 13 | X == 14) -> no change
       break;
     case ICmpInst::ICMP_SGT:        // (X s< 13 | X s> 15) -> (X-13) s> 2
@@ -4625,7 +4625,7 @@
     break;
   case ICmpInst::ICMP_UGT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X u> 13 | X == 15) -> X u> 13
     case ICmpInst::ICMP_UGT:        // (X u> 13 | X u> 15) -> X u> 13
       return ReplaceInstUsesWith(I, LHS);
@@ -4640,7 +4640,7 @@
     break;
   case ICmpInst::ICMP_SGT:
     switch (RHSCC) {
-    default: LLVM_UNREACHABLE("Unknown integer condition code!");
+    default: llvm_unreachable("Unknown integer condition code!");
     case ICmpInst::ICMP_EQ:         // (X s> 13 | X == 15) -> X > 13
     case ICmpInst::ICMP_SGT:        // (X s> 13 | X s> 15) -> X > 13
       return ReplaceInstUsesWith(I, LHS);
@@ -5717,7 +5717,7 @@
   
   ICmpInst::Predicate Pred;
   switch (I.getPredicate()) {
-  default: LLVM_UNREACHABLE("Unexpected predicate!");
+  default: llvm_unreachable("Unexpected predicate!");
   case FCmpInst::FCMP_UEQ:
   case FCmpInst::FCMP_OEQ:
     Pred = ICmpInst::ICMP_EQ;
@@ -5811,7 +5811,7 @@
       // the compare predicate and sometimes the value.  RHSC is rounded towards
       // zero at this point.
       switch (Pred) {
-      default: LLVM_UNREACHABLE("Unexpected integer comparison!");
+      default: llvm_unreachable("Unexpected integer comparison!");
       case ICmpInst::ICMP_NE:  // (float)int != 4.4   --> true
         return ReplaceInstUsesWith(I, Context->getConstantIntTrue());
       case ICmpInst::ICMP_EQ:  // (float)int == 4.4   --> false
@@ -5888,7 +5888,7 @@
   // Simplify 'fcmp pred X, X'
   if (Op0 == Op1) {
     switch (I.getPredicate()) {
-    default: LLVM_UNREACHABLE("Unknown predicate!");
+    default: llvm_unreachable("Unknown predicate!");
     case FCmpInst::FCMP_UEQ:    // True if unordered or equal
     case FCmpInst::FCMP_UGE:    // True if unordered, greater than, or equal
     case FCmpInst::FCMP_ULE:    // True if unordered, less than, or equal
@@ -6007,7 +6007,7 @@
   // icmp's with boolean values can always be turned into bitwise operations
   if (Ty == Type::Int1Ty) {
     switch (I.getPredicate()) {
-    default: LLVM_UNREACHABLE("Invalid icmp instruction!");
+    default: llvm_unreachable("Invalid icmp instruction!");
     case ICmpInst::ICMP_EQ: {               // icmp eq i1 A, B -> ~(A^B)
       Instruction *Xor = BinaryOperator::CreateXor(Op0, Op1, I.getName()+"tmp");
       InsertNewInstBefore(Xor, I);
@@ -6153,7 +6153,7 @@
     // Based on the range information we know about the LHS, see if we can
     // simplify this comparison.  For example, (x&4) < 8  is always true.
     switch (I.getPredicate()) {
-    default: LLVM_UNREACHABLE("Unknown icmp opcode!");
+    default: llvm_unreachable("Unknown icmp opcode!");
     case ICmpInst::ICMP_EQ:
       if (Op0Max.ult(Op1Min) || Op0Min.ugt(Op1Max))
         return ReplaceInstUsesWith(I, Context->getConstantIntFalse());
@@ -6662,7 +6662,7 @@
 
   Value *X = DivI->getOperand(0);
   switch (Pred) {
-  default: LLVM_UNREACHABLE("Unhandled icmp opcode!");
+  default: llvm_unreachable("Unhandled icmp opcode!");
   case ICmpInst::ICMP_EQ:
     if (LoOverflow && HiOverflow)
       return ReplaceInstUsesWith(ICI, Context->getConstantIntFalse());
@@ -8117,7 +8117,7 @@
   }
   default: 
     // TODO: Can handle more cases here.
-    LLVM_UNREACHABLE("Unreachable!");
+    llvm_unreachable("Unreachable!");
     break;
   }
   
@@ -8329,7 +8329,7 @@
     default:
       // All the others use floating point so we shouldn't actually 
       // get here because of the check above.
-      LLVM_UNREACHABLE("Unknown cast type");
+      llvm_unreachable("Unknown cast type");
     case Instruction::Trunc:
       DoXForm = true;
       break;
@@ -8385,7 +8385,7 @@
 
       assert(Res->getType() == DestTy);
       switch (CI.getOpcode()) {
-      default: LLVM_UNREACHABLE("Unknown cast type!");
+      default: llvm_unreachable("Unknown cast type!");
       case Instruction::Trunc:
         // Just replace this cast with the result.
         return ReplaceInstUsesWith(CI, Res);
@@ -9102,7 +9102,7 @@
 static Constant *GetSelectFoldableConstant(Instruction *I,
                                            LLVMContext *Context) {
   switch (I->getOpcode()) {
-  default: LLVM_UNREACHABLE("This cannot happen!");
+  default: llvm_unreachable("This cannot happen!");
   case Instruction::Add:
   case Instruction::Sub:
   case Instruction::Or:
@@ -9184,7 +9184,7 @@
     else
       return BinaryOperator::Create(BO->getOpcode(), NewSI, MatchOp);
   }
-  LLVM_UNREACHABLE("Shouldn't get here");
+  llvm_unreachable("Shouldn't get here");
   return 0;
 }
 
@@ -9226,7 +9226,7 @@
             NewSel->takeName(TVI);
             if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TVI))
               return BinaryOperator::Create(BO->getOpcode(), FalseVal, NewSel);
-            LLVM_UNREACHABLE("Unknown instruction!!");
+            llvm_unreachable("Unknown instruction!!");
           }
         }
       }
@@ -9255,7 +9255,7 @@
             NewSel->takeName(FVI);
             if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FVI))
               return BinaryOperator::Create(BO->getOpcode(), TrueVal, NewSel);
-            LLVM_UNREACHABLE("Unknown instruction!!");
+            llvm_unreachable("Unknown instruction!!");
           }
         }
       }
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 830895c..6ada288 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -456,7 +456,7 @@
     } else if (SCValue.isConstant())
       Succs[SI->findCaseValue(cast<ConstantInt>(SCValue.getConstant()))] = true;
   } else {
-    LLVM_UNREACHABLE("SCCP: Don't know how to handle this terminator!");
+    llvm_unreachable("SCCP: Don't know how to handle this terminator!");
   }
 }
 
@@ -517,7 +517,7 @@
 #ifndef NDEBUG
     cerr << "Unknown terminator instruction: " << *TI;
 #endif
-    llvm_unreachable();
+    llvm_unreachable(0);
   }
 }
 
@@ -1806,7 +1806,7 @@
           } else if (SwitchInst *SI = dyn_cast<SwitchInst>(I)) {
             assert(isa<UndefValue>(SI->getCondition()) && "Switch should fold");
           } else {
-            LLVM_UNREACHABLE("Didn't fold away reference to block!");
+            llvm_unreachable("Didn't fold away reference to block!");
           }
 #endif
           
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 2c97e57..83db90d 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -267,7 +267,7 @@
       // Check that all of the users of the allocation are capable of being
       // transformed.
       switch (isSafeAllocaToScalarRepl(AI)) {
-      default: LLVM_UNREACHABLE("Unexpected value!");
+      default: llvm_unreachable("Unexpected value!");
       case 0:  // Not safe to scalar replace.
         break;
       case 1:  // Safe, but requires cleanup/canonicalizations first
@@ -1511,7 +1511,7 @@
       continue;
     }
 
-    LLVM_UNREACHABLE("Unsupported operation!");
+    llvm_unreachable("Unsupported operation!");
   }
 }
 
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp
index c9af474..b8663de 100644
--- a/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -264,7 +264,7 @@
   case Instruction::Switch:    // Should remove entry
   default:
   case Instruction::Ret:       // Cannot happen, has no successors!
-    LLVM_UNREACHABLE("Unhandled terminator instruction type in RemoveSuccessor!");
+    llvm_unreachable("Unhandled terminator instruction type in RemoveSuccessor!");
   }
 
   if (NewTI)   // If it's a different instruction, replace.
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index f45f24c..bef1119 100644
--- a/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -223,7 +223,7 @@
     // If NewBBDominatesDestBB hasn't been computed yet, do so with DF.
     if (!OtherPreds.empty()) {
       // FIXME: IMPLEMENT THIS!
-      LLVM_UNREACHABLE("Requiring domfrontiers but not idom/domtree/domset."
+      llvm_unreachable("Requiring domfrontiers but not idom/domtree/domset."
                        " not implemented yet!");
     }
     
diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp
index 951d24f..f0b24c1 100644
--- a/lib/Transforms/Utils/ValueMapper.cpp
+++ b/lib/Transforms/Utils/ValueMapper.cpp
@@ -127,7 +127,7 @@
       return VM[V] = C;
 
     } else {
-      LLVM_UNREACHABLE("Unknown type of constant!");
+      llvm_unreachable("Unknown type of constant!");
     }
   }