This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Stop using std::iterator (NFC)
ClosedPublic

Authored by kazu on Sep 10 2022, 1:39 PM.

Details

Summary

With this patch, I get warnings like:

bolt/include/bolt/Core/BinaryContext.h:108:19: error:
'iterator<std::bidirectional_iterator_tag,
llvm::bolt::BinarySection>' is deprecated
[-Werror,-Wdeprecated-declarations]

This patch fixes those warnings by defining iterator_category,
value_type, etc.

This patch intentionally leaves duplicate types like FilterIterator::T
and FilterIterator::PointerT intact to avoid mixing the fix and the
cleanup.

Diff Detail

Event Timeline

kazu created this revision.Sep 10 2022, 1:39 PM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
kazu requested review of this revision.Sep 10 2022, 1:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2022, 1:39 PM
kazu added a reviewer: FPar.Sep 10 2022, 1:40 PM
kazu added a comment.Sep 13 2022, 9:26 AM

Please take a look. Thanks!

rafauler accepted this revision.Sep 13 2022, 1:34 PM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 13 2022, 1:34 PM

nit: fix the summary: "With this patch, I get warnings" --> "Without this patch, I get warnings"

This revision was automatically updated to reflect the committed changes.