[ptr-traits] Implement the base pointer traits using the actual
authorChandler Carruth <chandlerc@gmail.com>
Wed, 30 Dec 2015 04:00:24 +0000 (04:00 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 30 Dec 2015 04:00:24 +0000 (04:00 +0000)
commit13e79a46af0ed3036286111797bd4db08f45ecb9
tree2c84b937b7a7e7346fbe391b1c8e9b97acd81493
parentc1527e65f849267a3366d8cbbf5a621a839e0838
[ptr-traits] Implement the base pointer traits using the actual
alignment of the pointee type!

This is the culmination of the ptr-traits work. Now the compiler will
catch me if I try to use a pointer to an empty struct as a key in
a dense map or inside a PointerIntPair or PointerUnion! This is much,
much better than sometimes corrupting data (and other times working
fine) due to insufficient alignment.

It also means that we will be much more diligent about rejecting other
uses of these constructs that aren't safe.

It also means that we can now be more aggressive with the constructs
when we actually have guaranteed higher alignment without specializing
stuff. I'll be going through and cleaning up all the current overrides
of these traits which are no longer necessary.

Many thanks to Richard, David, and others who helped me get all of this
together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256620 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/PointerLikeTypeTraits.h