[PATCH] D35043: [ADT] Enable reverse iteration for DenseMap

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 22:55:11 PDT 2017


dblaikie added a comment.

This gets a bit trickier than the SmallPtrSet example already implemented - for pointers we know/expect they're unstable & so changing the iteration order is important.

For non-pointer keys in DenseMaps - do we want LLVM to be resilient to changes in hash algorithm or bucket size, etc? If so, that leads some credence to, for example: http://lists.llvm.org/pipermail/llvm-dev/2017-July/114983.html which I punted on.

I'm not sure it's important that LLVM be deterministic in the face of changes to its internal data structures like that, but if others disagree - I'm totally open to doing that work. I've no idea how far/close we are to conforming to that.

If it turns out that's not a good idea/a preferred goal, then this reverse iteration stuff could still be done - but would be conditionalized also on whether the key in the map is a pointer (or pointer-like - I think we have a trait for that) type & only reverse iteration in that case.


Repository:
  rL LLVM

https://reviews.llvm.org/D35043





More information about the llvm-commits mailing list