[ptr-traits] Refactor how PointerIntPair does its pointer manipulation
authorChandler Carruth <chandlerc@gmail.com>
Wed, 30 Dec 2015 03:56:19 +0000 (03:56 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 30 Dec 2015 03:56:19 +0000 (03:56 +0000)
commitc1527e65f849267a3366d8cbbf5a621a839e0838
treed28704a5dba9b953798c843a9d49817afb870984
parent140bb2d40b16867ef19c1912fec4a446bbc2bfbd
[ptr-traits] Refactor how PointerIntPair does its pointer manipulation
to isolate it in a dependent helper class.

Without doing this, we end up requiring all of the pointer traits the
moment you even define a PointerIntPair. That makes them *incredibly*
hard to use, for example you can't use them at all inside a class for
pointers to that class!

This change sinks all the logic into a helper template class that only
needs to be fully instantiated when *using* the PointerIntPair. We still
get compile-time checking, but it is deferred long enough to make
tradition out-of-line method definitions (or just the normal deferred
method body parsing) sufficient to handle cycling references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256618 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/PointerIntPair.h