PointerIntPair: Avoid an (academic) case of undefined behavior in the DenseMapInfo...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 15 Mar 2014 18:10:49 +0000 (18:10 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 15 Mar 2014 18:10:49 +0000 (18:10 +0000)
commit80d3b1e7087421008df3c6794b60beaf395efbeb
tree4cc4a5baba44fe9d56fe8620973b22ffb6fd2f28
parent14029414f51301c8543710ffd8f7c8c1e53789fe
PointerIntPair: Avoid an (academic) case of undefined behavior in the DenseMapInfo specialization.

If we use a pair with an enum type this could create values outside
of the enum range. Avoid it by creating the bit pattern directly.
While there turn a dynamic assert into a static one. No functionality
change.

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