add trivial support for passing label definitions through the MCStreamer.
[oota-llvm.git] / lib / CodeGen / MachineModuleInfo.cpp
index 724c113b79b943afe8fde1d7a633b117640cac9e..1d8109eb8d9954549854278d3229269e81054ddf 100644 (file)
@@ -36,7 +36,6 @@ char MachineModuleInfo::ID = 0;
   
 MachineModuleInfo::MachineModuleInfo()
 : ImmutablePass(&ID)
-, Lines()
 , LabelIDList()
 , FrameMoves()
 , LandingPads()
@@ -320,7 +319,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 +333,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();