Propagate debug info when building SelectionDAG.
[oota-llvm.git] / include / llvm / CodeGen / ScheduleDAGInstrs.h
index 2e5d8336352f9b4062668320ce8e0fc11d45d1fc..7c0e80afe43888eecf1f1529088facb0648cf018 100644 (file)
@@ -49,10 +49,11 @@ namespace llvm {
     ///
     SUnit *NewSUnit(MachineInstr *MI) {
 #ifndef NDEBUG
-      const SUnit *Addr = &SUnits[0];
+      const SUnit *Addr = SUnits.empty() ? 0 : &SUnits[0];
 #endif
       SUnits.push_back(SUnit(MI, (unsigned)SUnits.size()));
-      assert(Addr == &SUnits[0] && "SUnits std::vector reallocated on the fly!");
+      assert((Addr == 0 || Addr == &SUnits[0]) &&
+             "SUnits std::vector reallocated on the fly!");
       SUnits.back().OrigNode = &SUnits.back();
       return &SUnits.back();
     }