ADT: Share code for embedded sentinel traits, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 12 Aug 2016 15:00:55 +0000 (15:00 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 12 Aug 2016 15:00:55 +0000 (15:00 +0000)
commit0d2ed35d3ea8a6625142d677dd71ee44ee0ec1b1
treed5685e7f6ca791232121b4b7fa974c6ce90e2063
parentad7eb9db466874dbc28c0dc2fbeb7226bbd9004b
ADT: Share code for embedded sentinel traits, NFC

Share code for the (mostly problematic) embedded sentinel traits.
- Move the LLVM_NO_SANITIZE("object-size") attribute to
  ilist_half_embedded_sentinel_traits and ilist_embedded_sentinel_traits
  (previously it spread throughout the code duplication).
- Add an ilist_full_embedded_sentinel_traits which has no UB (but has
  the downside of storing the complete node).
- Replace all the custom sentinel traits in LLVM with a declaration of
  ilist_sentinel_traits that inherits from one of the embedded sentinel
  traits classes.

There are still custom sentinel traits in other LLVM subprojects.  I'll
remove those in a follow-up.

Nothing at all should be changing here, this is just rearranging code.
Note that the final goal here is to remove the sentinel traits
altogether, settling on the memory layout of
ilist_half_embedded_sentinel_traits without the UB.  This intermediate
step moves the logic into ilist.h.

llvm-svn: 278513
llvm/include/llvm/ADT/SparseBitVector.h
llvm/include/llvm/ADT/ilist.h
llvm/include/llvm/Analysis/IVUsers.h
llvm/include/llvm/CodeGen/MachineBasicBlock.h
llvm/include/llvm/CodeGen/MachineFunction.h
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/include/llvm/CodeGen/SlotIndexes.h
llvm/include/llvm/IR/Module.h
llvm/include/llvm/Transforms/Utils/MemorySSA.h
llvm/lib/Support/YAMLParser.cpp