Add a DenseMapInfo specialization for BasicBlockEdge
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
The use case for this is that anything that includes Dominators.h gets this definition of BasicBlockEdge. and it seems like an okay one at a glance, so may as well reuse it. This is what is required to use them as a DenseMap key.
The other easy option i see is to just typedef BasicBlockEdge to std::pair<const BasicBlock *, const BasicBlock *> here, and make isSingleEdge (which has 3 uses in all of llvm) a non-member function.
In fact, all the code for our DenseMapInfo is just being reused from the existing std::pair specialization DenseMapInfo has.
Not sure which we prefer, happy to do either
What would happen if you made BasicBlockEdge convertible into a std::pair<const BasicBlock *, const BasicBlock *>? Would you still need this?
Given that the conversion does not work, this LGTM. I'd rather have real names for the endpoints (not just first and second as we'd get if we use pair).