From: Quentin Colombet Date: Sat, 7 Jan 2017 00:46:30 +0000 (+0000) Subject: [MachineBasicBlock] Add a non-assert live-in accessor for debug mode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d87ddcb9f0e947e01b15ca3d72516838ee6f3085;p=llvm [MachineBasicBlock] Add a non-assert live-in accessor for debug mode. With r291169, it is now not possible to access the live-in information when the liveness is not properly tracked. Although this is want we want in general, for debugging purpose we may want to still be able to traverse this information even if it may not be accurate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291317 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 92a9896d7a1..f3f5e324d76 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -308,6 +308,16 @@ public: // Iteration support for live in sets. These sets are kept in sorted // order by their register number. typedef LiveInVector::const_iterator livein_iterator; +#ifndef NDEBUG + /// Unlike livein_begin, this method does not check that the liveness + /// information is accurate. Still for debug purposes it may be useful + /// to have iterators that won't assert if the liveness information + /// is not current. + livein_iterator livein_begin_dbg() const { return LiveIns.begin(); } + iterator_range liveins_dbg() const { + return make_range(livein_begin_dbg(), livein_end()); + } +#endif livein_iterator livein_begin() const; livein_iterator livein_end() const { return LiveIns.end(); } bool livein_empty() const { return LiveIns.empty(); }