[ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.
Previously, the assertions in PointerIntPair would try to calculate the value (1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were more than 31 bits available we'd get a shift overflow. Also, add a rudimentary unit test file for PointerIntPair. llvm-svn: 203273
Showing
- llvm/include/llvm/ADT/PointerIntPair.h 9 additions, 5 deletionsllvm/include/llvm/ADT/PointerIntPair.h
- llvm/unittests/ADT/CMakeLists.txt 1 addition, 0 deletionsllvm/unittests/ADT/CMakeLists.txt
- llvm/unittests/ADT/PointerIntPairTest.cpp 74 additions, 0 deletionsllvm/unittests/ADT/PointerIntPairTest.cpp
llvm/unittests/ADT/PointerIntPairTest.cpp
0 → 100644
Please register or sign in to comment