OSDN Git Service

ADT: Separate some list manipulation API into ilist_base, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 22 Aug 2016 22:21:07 +0000 (22:21 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 22 Aug 2016 22:21:07 +0000 (22:21 +0000)
commitfd2abc5908bd31fc044ede021676f542197d9026
tree32fdd3fa12ccee9e68f7d911c25ab14eee031f01
parent9ed748efefa3ba5e57d07d0b56f3b766e490362e
ADT: Separate some list manipulation API into ilist_base, NFC

Separate algorithms in iplist<T> that don't depend on T into ilist_base,
and unit test them.

While I was adding unit tests for these algorithms anyway, I also added
unit tests for ilist_node_base and ilist_sentinel<T>.

To make the algorithms and unit tests easier to write, I also did the
following minor changes as a drive-by:
- encapsulate Prev/Next in ilist_node_base to so that algorithms are
  easier to read, and
- update ilist_node_access API to take nodes by reference.

There should be no real functionality change here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279484 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/ilist.h
include/llvm/ADT/ilist_node.h
unittests/ADT/CMakeLists.txt
unittests/ADT/IListBaseTest.cpp [new file with mode: 0644]
unittests/ADT/IListNodeBaseTest.cpp [new file with mode: 0644]
unittests/ADT/IListSentinelTest.cpp [new file with mode: 0644]