Fix assert(0) conversion, as suggested by Chris.
authorTorok Edwin <edwintorok@gmail.com>
Sun, 12 Jul 2009 20:07:01 +0000 (20:07 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Sun, 12 Jul 2009 20:07:01 +0000 (20:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75423 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/IfConversion.cpp
lib/CodeGen/PreAllocSplitting.cpp
lib/CodeGen/RegisterScavenging.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 739c06b11a3341341de4c1e1ce6e48789019e6bc..02249c9fce1f1c0c01c36ced8a003c00afe97f49 100644 (file)
@@ -1132,10 +1132,10 @@ void IfConverter::PredicateBlock(BBInfo &BBI,
     if (TII->isPredicated(I))
       continue;
     if (!TII->PredicateInstruction(I, Cond)) {
-      std::string msg;
-      raw_string_ostream Msg(msg);
-      Msg << "Unable to predicate " << *I << "!";
-      llvm_report_error(Msg.str());
+#ifndef NDEBUG
+      cerr << "Unable to predicate " << *I << "!\n";
+#endif
+      llvm_unreachable();
     }
   }
 
@@ -1168,10 +1168,10 @@ void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
 
     if (!isPredicated)
       if (!TII->PredicateInstruction(MI, Cond)) {
-        std::string msg;
-        raw_string_ostream Msg(msg);
-        Msg << "Unable to predicate " << *MI << "!";
-        llvm_report_error(Msg.str());
+#ifndef NDEBUG
+        cerr << "Unable to predicate " << *I << "!\n";
+#endif
+        llvm_unreachable();
       }
   }
 
index 52a403bd363c33f179f8c2393be72bc50b7e2161..c49575bade65d21363aaf87d92ae8e7e068e43fe 100644 (file)
@@ -1035,10 +1035,7 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
     CurrLI->FindLiveRangeContaining(LIs->getUseIndex(BarrierIdx));
   VNInfo *ValNo = LR->valno;
 
-  if (ValNo->isUnused()) {
-    // Defined by a dead def? How can this be?
-    LLVM_UNREACHABLE("Val# is defined by a dead def?");
-  }
+  assert(!ValNo->isUnused() && "Val# is defined by a dead def?");
 
   MachineInstr *DefMI = ValNo->isDefAccurate()
     ? LIs->getInstructionFromIndex(ValNo->def) : NULL;
index ab9a0e340d2d4b4ad76aa49aa91811234b485685..84cff8d5d882ce04ac3fd86ffbb7ba3eb9c00a89 100644 (file)
@@ -459,9 +459,8 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
     Reg = Candidates.find_next(Reg);
   }
 
-  if (ScavengedReg != 0) {
-    LLVM_UNREACHABLE("Scavenger slot is live, unable to scavenge another register!");
-  }
+  assert(ScavengedReg == 0 && 
+         "Scavenger slot is live, unable to scavenge another register!");
 
   // Spill the scavenged register before I.
   TII->storeRegToStackSlot(*MBB, I, SReg, true, ScavengingFrameIndex, RC);
index b084ab79a7906ee969ae42059cc61e4061a9c056..6d7c9c07de9ecf5e5e07de1341a9a7538cd9ec90 100644 (file)
@@ -152,9 +152,12 @@ namespace llvm {
 // basic blocks, and the scheduler passes ownership of it to this method.
 MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
                                                  MachineBasicBlock *MBB) const {
-  llvm_report_error("If a target marks an instruction with "
-                    "'usesCustomDAGSchedInserter', it must implement "
-                    "TargetLowering::EmitInstrWithCustomInserter!");
+#ifndef NDEBUG
+  cerr << "If a target marks an instruction with "
+          "'usesCustomDAGSchedInserter', it must implement "
+          "TargetLowering::EmitInstrWithCustomInserter!";
+#endif
+  llvm_unreachable();
   return 0;  
 }
 
@@ -831,8 +834,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
               cerr << "FastISel miss: ";
               BI->dump();
             }
-            if (EnableFastISelAbort)
-              LLVM_UNREACHABLE("FastISel didn't handle a PHI in a successor");
+            assert(!EnableFastISelAbort && 
+                   "FastISel didn't handle a PHI in a successor");
             break;
           }