diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-22 21:08:08 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-22 21:08:08 +0000 |
commit | 361c31da5e9bd70d6b336207056519af9ff94062 (patch) | |
tree | 967b6bb92f085d2d332f8f34fb6de323059fd34c /include/llvm/CodeGen/ScheduleDAGInstrs.h | |
parent | fb8a1356b2aa2869b2a8ad13fe87bc43c349dd31 (diff) | |
download | external_llvm-361c31da5e9bd70d6b336207056519af9ff94062.zip external_llvm-361c31da5e9bd70d6b336207056519af9ff94062.tar.gz external_llvm-361c31da5e9bd70d6b336207056519af9ff94062.tar.bz2 |
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
Diffstat (limited to 'include/llvm/CodeGen/ScheduleDAGInstrs.h')
-rw-r--r-- | include/llvm/CodeGen/ScheduleDAGInstrs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ScheduleDAGInstrs.h b/include/llvm/CodeGen/ScheduleDAGInstrs.h index c74ef57..cfea3e0 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(); } |