This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Clean up `enumerate` implementation. NFC.
ClosedPublic

Authored by kuhar on Feb 28 2023, 7:55 PM.

Details

Summary
  • Remove unnecessary member functions.
  • Fix code sample.

This is in preparation for landing future changes in https://reviews.llvm.org/D144503.

Diff Detail

Event Timeline

kuhar created this revision.Feb 28 2023, 7:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2023, 7:55 PM
Herald added a subscriber: hanchung. · View Herald Transcript
kuhar requested review of this revision.Feb 28 2023, 7:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2023, 7:55 PM
zero9178 accepted this revision.Mar 1 2023, 12:46 AM

LGTM % default constructor

llvm/include/llvm/ADT/STLExtras.h
2200

Any reason not having a default constructor is desired? I'd keep it just to avoid someone needing it in the future

This revision is now accepted and ready to land.Mar 1 2023, 12:46 AM
kuhar marked an inline comment as done.Mar 1 2023, 7:37 AM
kuhar added inline comments.
llvm/include/llvm/ADT/STLExtras.h
2200

result_pair is a wrapper around an iterator, and only gets created when there are some iterators to wrap in the first place. Why would we want to define a default constructor for an internal class with no uses in the code base? If there's a legitimate need in the future, I think it can be added back trivially.

zero9178 added inline comments.Mar 1 2023, 1:30 PM
llvm/include/llvm/ADT/STLExtras.h
2200

Yeah fair enough. I also forgot this was in a details namespace, so direct use is discouraged anways. Thanks for the conversation!

This revision was automatically updated to reflect the committed changes.
kuhar marked an inline comment as done.