From: Dan Gohman Date: Mon, 22 Dec 2008 21:08:08 +0000 (+0000) Subject: Add an assertion to the ScheduleDAGInstrs class to catch SUnits X-Git-Tag: android-x86-6.0-r1~1047^2~16725 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f3470027769ea7b1d6b5b34286d8bbd0efb318de;p=android-x86%2Fexternal-llvm.git Add an assertion to the ScheduleDAGInstrs class to catch SUnits reallocations. We don't do cloning on MachineInstr schedule DAGs, but this is a worthwhile sanity check regardless. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61343 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/ScheduleDAGInstrs.h b/include/llvm/CodeGen/ScheduleDAGInstrs.h index c74ef57674f..cfea3e08895 100644 --- a/include/llvm/CodeGen/ScheduleDAGInstrs.h +++ b/include/llvm/CodeGen/ScheduleDAGInstrs.h @@ -36,7 +36,11 @@ namespace llvm { /// NewSUnit - Creates a new SUnit and return a ptr to it. /// SUnit *NewSUnit(MachineInstr *MI) { +#ifndef NDEBUG + const SUnit *Addr = &SUnits[0]; +#endif SUnits.push_back(SUnit(MI, (unsigned)SUnits.size())); + assert(Addr == &SUnits[0] && "SUnits std::vector reallocated on the fly!"); SUnits.back().OrigNode = &SUnits.back(); return &SUnits.back(); }