[llvm-commits] [llvm] r61343 - /llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h
Dan Gohman
gohman at apple.com
Mon Dec 22 13:08:09 PST 2008
Author: djg
Date: Mon Dec 22 15:08:08 2008
New Revision: 61343
URL: http://llvm.org/viewvc/llvm-project?rev=61343&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h
Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h?rev=61343&r1=61342&r2=61343&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h Mon Dec 22 15:08:08 2008
@@ -36,7 +36,11 @@
/// 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();
}
More information about the llvm-commits
mailing list