llvm/unittests
Duncan P. N. Exon Smith 21bcd75d9b ADT: Remove all ilist_iterator => pointer casts, NFC
Remove all ilist_iterator to pointer casts.  There were two reasons for
casts:

  - Checking for an uninitialized (i.e., null) iterator.  I added
    MachineInstrBundleIterator::isValid() to check for that case.

  - Comparing an iterator against the underlying pointer value while
    avoiding converting the pointer value to an iterator.  This is
    occasionally necessary in MachineInstrBundleIterator, since there is
    an assertion in the constructors that the underlying MachineInstr is
    not bundled (but we don't care about that if we're just checking for
    pointer equality).

To support the latter case, I rewrote the == and != operators for
ilist_iterator and MachineInstrBundleIterator.

  - The implicit constructors now use enable_if to exclude
    const-iterator => non-const-iterator conversions from overload
    resolution (previously it was a compiler error on instantiation, now
    it's SFINAE).

  - The == and != operators are now global (friends), and are not
    templated.

  - MachineInstrBundleIterator has overloads to compare against both
    const_pointer and const_reference.  This avoids the implicit
    conversions to MachineInstrBundleIterator that assert, instead just
    checking the address (and I added unit tests to confirm this).

Notably, the only remaining uses of ilist_iterator::getNodePtrUnchecked
are in ilist.h, and no code outside of ilist*.h directly relies on this
UB end-iterator-to-pointer conversion anymore.  It's still needed for
ilist_*sentinel_traits, but I'll clean that up soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 05:05:36 +00:00
..
ADT [ADT] Add relation operators for Optional 2016-08-11 20:10:15 +00:00
Analysis Consistently use LoopAnalysisManager 2016-08-09 00:28:52 +00:00
AsmParser
Bitcode
CodeGen ADT: Remove all ilist_iterator => pointer casts, NFC 2016-08-12 05:05:36 +00:00
DebugInfo [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
ExecutionEngine Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
IR IR: Drop uniquing when an MDNode Value operand is deleted 2016-08-03 18:19:43 +00:00
LineEditor
Linker Remangle intrinsics names when types are renamed 2016-06-24 15:10:29 +00:00
MC
MI MIRParser: Use dot instead of colon to mark subregisters 2016-07-26 21:49:34 +00:00
ObjectYAML
Option
ProfileData Use the range variant of find_if instead of unpacking begin/end 2016-08-12 00:18:03 +00:00
Support Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
Transforms [MSSA] clang-format. NFC. 2016-08-03 19:59:11 +00:00
CMakeLists.txt