Use large alignment when calculating empty/tombstone keys
for T*. We can't use alignof(T), as T may be forward-declared at
this point, and PointerLikeTypeTraits<T*>::NumLowBitsAvailable may
be too small.
Details
Diff Detail
Event Timeline
I'm curious why we need to support forward declared types. It seems really
brittle. Have you looked into this much? If not, I can.
I had a similar patch here: http://reviews.llvm.org/D5428
I went with a different approach to handle global objects which were massively over-aligned (unlikely, but possible).
include/llvm/ADT/DenseMapInfo.h | ||
---|---|---|
38–47 | Would using std::max make this more readable? |
If your class has a member llvm::DenseMap<llvm::AllocaInst *, Foo>, it's a common practice to forward-declare llvm::AllocaInst.
Right, your patch looks slightly better. I'd be happy to see either of these commited :)
include/llvm/ADT/DenseMapInfo.h | ||
---|---|---|
38–47 | This header is included by almost every LLVM source. I didn't want to #include <algorithm> here. |
Would using std::max make this more readable?