This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Use a struct to pass function search options to Module::FindFunction
ClosedPublic

Authored by JDevlieghere on Aug 2 2021, 10:38 AM.

Details

Summary

Rather than passing two bools (next to each other), use a struct instead.

Diff Detail

Event Timeline

JDevlieghere requested review of this revision.Aug 2 2021, 10:38 AM
JDevlieghere created this revision.

I like the idea! Could be a little cleaner imo, but shouldn't be a blocker if others don't think so.

lldb/include/lldb/Core/Module.h
62

nit: Maybe a name like ModuleFunctionSearchOptions? A bit more verbose but I wasn't sure what ModuleFunctionOptions meant at first.

lldb/source/API/SBModule.cpp
401–403

nit: IMO this looks cleaner, but no big deal:

ModuleFunctionOptions function_options = { .include_symbols = true, .include_inlines = true };
JDevlieghere marked 2 inline comments as done.

Thanks, updated the diff accordingly.

This revision is now accepted and ready to land.Aug 2 2021, 11:36 AM
shafik added a subscriber: shafik.Aug 2 2021, 4:01 PM
shafik added inline comments.
lldb/source/API/SBModule.cpp
401–403

I love designated initializers (this is a nice use) but this is a C++20 feature and so we would be using this as a GNU extension, which might break some builds.

godbolt: https://godbolt.org/z/TKMddMrq3

shafik accepted this revision.Aug 5 2021, 9:21 AM

LGTM

This revision was landed with ongoing or failed builds.Aug 5 2021, 10:18 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2021, 10:18 AM