summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/LiveInterval.h
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-07-10 05:06:03 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-07-10 05:06:03 +0000
commit261b6330896736f674bdb2dd4556a0483f3cfe8d (patch)
tree666aac478a1de9d9c0c79a3dc544dcf4764f802f /include/llvm/CodeGen/LiveInterval.h
parenta4fba5eaf8e62bd08d75cd3e79fb40fc4fb71c16 (diff)
downloadllvm-261b6330896736f674bdb2dd4556a0483f3cfe8d.tar.gz
llvm-261b6330896736f674bdb2dd4556a0483f3cfe8d.tar.bz2
llvm-261b6330896736f674bdb2dd4556a0483f3cfe8d.tar.xz
Teach LiveIntervals how to verify themselves and start using it in some
of the trick merge routines. This adds a layer of testing that was necessary when implementing more efficient (and complex) merge logic for this datastructure. No functionality changed here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveInterval.h')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 30acaff62b..e26a47a6ee 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -489,6 +489,15 @@ namespace llvm {
void print(raw_ostream &OS) const;
void dump() const;
+ /// \brief Walk the interval and assert if any invariants fail to hold.
+ ///
+ /// Note that this is a no-op when asserts are disabled.
+#ifdef NDEBUG
+ void verify() const {}
+#else
+ void verify() const;
+#endif
+
private:
Ranges::iterator addRangeFrom(LiveRange LR, Ranges::iterator From);