assert(0) -> LLVM_UNREACHABLE.
[oota-llvm.git] / lib / CodeGen / MachineModuleInfo.cpp
index 724c113b79b943afe8fde1d7a633b117640cac9e..798492bf329a9ee0ead91770cefaa5772e633245 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #include "llvm/Support/Dwarf.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Streams.h"
 using namespace llvm;
 using namespace llvm::dwarf;
@@ -36,7 +37,6 @@ char MachineModuleInfo::ID = 0;
   
 MachineModuleInfo::MachineModuleInfo()
 : ImmutablePass(&ID)
-, Lines()
 , LabelIDList()
 , FrameMoves()
 , LandingPads()
@@ -291,7 +291,7 @@ unsigned MachineModuleInfo::getPersonalityIndex() const {
   }
 
   // This should never happen
-  assert(0 && "Personality function should be set!");
+  LLVM_UNREACHABLE("Personality function should be set!");
   return 0;
 }
 
@@ -320,7 +320,7 @@ char DebugLabelFolder::ID = 0;
 
 bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
   // Get machine module info.
-  MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   if (!MMI) return false;
   
   // Track if change is made.
@@ -334,7 +334,7 @@ bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
     // Iterate through instructions.
     for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
       // Is it a label.
-      if (I->isDebugLabel(){
+      if (I->isDebugLabel() && !MMI->isDbgLabelUsed(I->getOperand(0).getImm())){
         // The label ID # is always operand #0, an immediate.
         unsigned NextLabel = I->getOperand(0).getImm();