Simplify the pair optimization. Rather than using complex type traits,
authorChandler Carruth <chandlerc@gmail.com>
Fri, 2 Mar 2012 10:56:40 +0000 (10:56 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 2 Mar 2012 10:56:40 +0000 (10:56 +0000)
commit1c1448984d43f1f02c0235d35ebe8460c9b57afd
treec15c8c05b0a683a2653c6d0e61edb9f04dc042bc
parentd8313be41031e4d768f5b38199904d4debff88cd
Simplify the pair optimization. Rather than using complex type traits,
just ensure that the number of bytes in the pair is the sum of the bytes
in each side of the pair. As long as thats true, there are no extra
bytes that might be padding.

Also add a few tests that previously would have slipped through the
checking. The more accurate checking mechanism catches these and ensures
they are handled conservatively correctly.

Thanks to Duncan for prodding me to do this right and more simply.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151891 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/Hashing.h
include/llvm/Support/type_traits.h
unittests/ADT/HashingTest.cpp