ADT: Split out iplist_impl from iplist, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 3 Sep 2016 02:07:45 +0000 (02:07 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 3 Sep 2016 02:07:45 +0000 (02:07 +0000)
commit3453d51c51b1ea7a9dafaa1b490b76d5ed0c2f7d
tree4af9dfec44c897469e413e71122b35d24b799418
parentc37307a5f473af4a08603791ae8e251bc2f5e359
ADT: Split out iplist_impl from iplist, NFC

Split out iplist_impl from iplist, and change SymbolTableList to inherit
directly from iplist_impl.  This makes it more straightforward to add
new template paramaters to iplist [*]:
- iplist_impl takes a "base" list that provides the intrusive
  functionality (usually simple_ilist<T>) and a traits class.
- iplist no longer takes a "Traits" template parameter.  It only takes
  the value_type, T, and instantiates iplist_impl with simple_ilist<T>
  and ilist_traits<T>.
- SymbolTableList now inherits from iplist_impl, instead of iplist.

Note for out-of-tree code: if you have an iplist whose second template
parameter was *not* the default (i.e., not ilist_traits<YourT>), you
have three options:
- Stop using a custom traits class, and instead specialize
  ilist_traits<YourT>.  This is the usual thing to do.
- Specialize iplist<YourT> to pass your custom traits class into
  iplist_impl.
- Create your own trivial list type that passes your custom traits class
  into iplist_impl (see SymbolTableList<> for an example).

[*]: The eventual goal is to start tracking a sentinel bit on the
MachineInstr list even when LLVM_ENABLE_ABI_BREAKING_CHECKS is off,
which will enable MachineBasicBlock::reverse_iterator to have normal
list invalidation semantics that matching the new
iplist<>::reverse_iterator from r280032.

llvm-svn: 280569
llvm/include/llvm/ADT/ilist.h
llvm/include/llvm/IR/SymbolTableListTraits.h