This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] Remove custom matcher classes in Listener in favor of lambdas
ClosedPublic

Authored by bulbazord on Jun 13 2023, 11:25 AM.

Details

Summary

Instead of writing boilerplate classes to serve as matchers for things
like find_if and erase_if, we can use lambdas. I believe this
simplifies the Listener class.

Diff Detail

Event Timeline

bulbazord created this revision.Jun 13 2023, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 11:25 AM
bulbazord requested review of this revision.Jun 13 2023, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 11:25 AM
mib added inline comments.Jun 13 2023, 12:55 PM
lldb/source/Utility/Listener.cpp
212–213

Since you used llvm::erased_it above, could you use llvm::find_if here as well to stay consistent. It will also make this line shorter since you can just pass the container instead of passing the beginning and ending iterators.

368

ditto

fdeazeve accepted this revision.Jun 14 2023, 6:38 AM

Nice catch! Also agree with the suggestion of using the STLExtras wrapper

This revision is now accepted and ready to land.Jun 14 2023, 6:38 AM

Use STLExtras where appropriate