Various minor fixes for python 3

Switch StdTuple printer from python 2-style "next" to python 3.

Nested iteration changed enough to make the original bitset iteration
code a bit trickier than it needs to be, so unnest.

The end node of a map iterator is sometimes hard to detect in isolation,
don't fail in that case.

Differential Revision: https://reviews.llvm.org/D96167

GitOrigin-RevId: a34b8b879e345397880c1f9f8de4c294dd0b370c
2 files changed