We expose the fact that we rely on unsigned wrapping to iterate through
all indexes. This can be confusing. Rather, keeping it as an
implementation detail through an iterator is less confusing and is less
code.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 126648 Build 183991: arc lint + arc unit
Event Timeline
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | ||
---|---|---|
838 | You changed this one to auto but left the others unsigned. I think leaving it as unsigned makes more sense since it is not obvious what we expect the type to be here. |
Comment Actions
I had another idle thought on this matter: The unsigned overflow here really isn't that weird. It's the same thing as iterating over the range [-1, 0, #args+1]. We could update all these APIs to traffic in plain signed ints, and then there would be no wrapping, just normal index math.
This deserves a comment just for consistency with the rest of these top-level members, even though it's a boring implementation detail of indexes().