remove the SelectSectionForMachineConst hook, replacing it with
[oota-llvm.git] / lib / CodeGen / IfConversion.cpp
index 4d5c3c2c7dc711ed99d16728fe82423b6992606b..608d18d591eb784c2a1b96ce36a639c7d6490a2c 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/STLExtras.h"
@@ -144,9 +146,10 @@ namespace {
     const TargetLowering *TLI;
     const TargetInstrInfo *TII;
     bool MadeChange;
+    int FnNum;
   public:
     static char ID;
-    IfConverter() : MachineFunctionPass(&ID) {}
+    IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {}
 
     virtual bool runOnMachineFunction(MachineFunction &MF);
     virtual const char *getPassName() const { return "If Converter"; }
@@ -225,7 +228,6 @@ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
   TII = MF.getTarget().getInstrInfo();
   if (!TII) return false;
 
-  static int FnNum = -1;
   DOUT << "\nIfcvt: function (" << ++FnNum <<  ") \'"
        << MF.getFunction()->getName() << "\'";
 
@@ -1130,8 +1132,10 @@ void IfConverter::PredicateBlock(BBInfo &BBI,
     if (TII->isPredicated(I))
       continue;
     if (!TII->PredicateInstruction(I, Cond)) {
+#ifndef NDEBUG
       cerr << "Unable to predicate " << *I << "!\n";
-      abort();
+#endif
+      llvm_unreachable(0);
     }
   }
 
@@ -1164,8 +1168,10 @@ void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
 
     if (!isPredicated)
       if (!TII->PredicateInstruction(MI, Cond)) {
-        cerr << "Unable to predicate " << *MI << "!\n";
-        abort();
+#ifndef NDEBUG
+        cerr << "Unable to predicate " << *I << "!\n";
+#endif
+        llvm_unreachable(0);
       }
   }