Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
[oota-llvm.git] / lib / Transforms / Scalar / ScalarReplAggregates.cpp
index b5e219fbf1ff32c439f7068c76518ddee4de510a..da2c375be9090bd7f054703ad9f30e4df7079a92 100644 (file)
@@ -34,6 +34,7 @@
 #include "llvm/Transforms/Utils/PromoteMemToReg.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
 #include "llvm/Support/IRBuilder.h"
 #include "llvm/Support/MathExtras.h"
@@ -1193,9 +1194,9 @@ void SROA::CleanupGEP(GetElementPtrInst *GEPI) {
   assert(NumElements == 2 && "Unhandled case!");
   // All users of the GEP must be loads.  At each use of the GEP, insert
   // two loads of the appropriate indexed GEP and select between them.
-  Value *IsOne = new ICmpInst(ICmpInst::ICMP_NE, I.getOperand(), 
+  Value *IsOne = new ICmpInst(GEPI, ICmpInst::ICMP_NE, I.getOperand(), 
                               Context->getNullValue(I.getOperand()->getType()),
-                              "isone", GEPI);
+                              "isone");
   // Insert the new GEP instructions, which are properly indexed.
   SmallVector<Value*, 8> Indices(GEPI->op_begin()+1, GEPI->op_end());
   Indices[1] = Context->getNullValue(Type::Int32Ty);
@@ -1261,7 +1262,7 @@ void SROA::CleanupAllocaUsers(AllocationInst *AI) {
 ///      and stores would mutate the memory.
 static void MergeInType(const Type *In, uint64_t Offset, const Type *&VecTy,
                         unsigned AllocaSize, const TargetData &TD,
-                        LLVMContextContext) {
+                        LLVMContext *Context) {
   // If this could be contributing to a vector, analyze it.
   if (VecTy != Type::VoidTy) { // either null or a vector type.
 
@@ -1510,8 +1511,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, uint64_t Offset) {
       continue;
     }
 
-    assert(0 && "Unsupported operation!");
-    abort();
+    LLVM_UNREACHABLE("Unsupported operation!");
   }
 }