This was originally motivated by a compile time problem I've since figured out how to solve differently, but the cleanup seemed useful. We had the same logic - which essentially implemented find - in several places. By commoning them out, I can implement find and allow erase to be inlined at the call sites if profitable.
Details
Diff Detail
Event Timeline
LGTM, minor formatting tweaks.
include/llvm/ADT/SmallPtrSet.h | ||
---|---|---|
197–198 | extraneous blank lines? |
include/llvm/ADT/SmallPtrSet.h | ||
---|---|---|
389 | endPtr is already in tree. This is almost "end()", but it can't be because of the breaking API check logic. Honestly, the breaking API check logic looks broken to me. :( It doesn't seem to cover anything other than begin/end, whereas we return other forms of iterators and might reasonable compare them against end. |
include/llvm/ADT/SmallPtrSet.h | ||
---|---|---|
389 | Yeah, this part looks fine. I was looking at a stale version of SmallPtrSet. |
Early return here if P == EndPointer()?