llvm/unittests/CodeGen
Duncan P. N. Exon Smith 00530c8441 CodeGen: Assert that bundle iterators are valid
Add an assertion to the MachineInstrBundleIterator from instr_iterator
that the underlying iterator is valid.  This is possible know that we
can check ilist_node::isSentinel (since r281168), and is consistent with
the constructors from MachineInstr* and MachineInstr&.

Avoiding the new assertion in operator== and operator!= requires four
(!!!!) new overloads each.

(As an aside, I'm strongly in favour of:
- making the conversion from instr_iterator explicit;
- making the conversion from pointer explicit;
- making the conversion from reference explicit; and
- removing all the extra overloads of operator== and operator!= except
  const_instr_iterator.

I'm not signing up for that at this point, but being clear about when
something is an MachineInstr-iterator (possibly instr_end()) vs
MachineInstr-bundle-iterator (possibly end()) vs MachineInstr* (possibly
nullptr) vs MachineInstr& (known valid) would surely make code
cleaner... and it would remove a ton of boilerplate from
MachineInstrBundleIterator operators.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 17:12:28 +00:00
..
GlobalISel GlobalISel: use multi-dimensional arrays for legalize actions. 2016-08-29 21:00:00 +00:00
CMakeLists.txt ADT: Remove all ilist_iterator => pointer casts, NFC 2016-08-12 05:05:36 +00:00
DIEHashTest.cpp Fix header comment in unittests/CodeGen/DIEHashTest.cpp. 2016-07-13 18:38:20 +00:00
LowLevelTypeTest.cpp GlobalISel: support loads and stores of strange types. 2016-08-15 21:13:17 +00:00
MachineInstrBundleIteratorTest.cpp CodeGen: Assert that bundle iterators are valid 2016-09-11 17:12:28 +00:00