This is an archive of the discontinued LLVM Phabricator instance.

Allow DenseSet::iterators to be conveted to and compared with const_iterator
ClosedPublic

Authored by varno on Jan 22 2017, 7:23 PM.

Details

Summary

This seemed to be an oversight seeing as DenseMap has these conversions.

This patch does the following:

  • Adds a default constructor to the iterators.
  • Allows DenseSet::ConstIterators to be copy constructed from DenseSet::Iterators
  • Allows mutual comparison between Iterators and ConstIterators.

All of these are available in the DenseMap implementation, so the implementation here is trivial.

Diff Detail

Repository
rL LLVM

Event Timeline

varno created this revision.Jan 22 2017, 7:23 PM
varno edited the summary of this revision. (Show Details)Jan 22 2017, 7:27 PM
dberris accepted this revision.Jan 22 2017, 7:30 PM
dberris added inline comments.
include/llvm/ADT/DenseSet.h
107 ↗(On Diff #85311)

Spurious ;

138 ↗(On Diff #85311)

Spurious ;

This revision is now accepted and ready to land.Jan 22 2017, 7:30 PM
varno updated this revision to Diff 85320.Jan 22 2017, 9:50 PM
  • address review comments
  • add tests
varno updated this revision to Diff 85323.Jan 22 2017, 9:58 PM
  • add space
varno marked 2 inline comments as done.Jan 22 2017, 9:58 PM
varno added a comment.Jan 23 2017, 8:05 PM

I cannot commit myself, could someone do this for me?

This revision was automatically updated to reflect the committed changes.