This is an archive of the discontinued LLVM Phabricator instance.

[lldb][nfc] Refactor methods with out parameter
ClosedPublic

Authored by fdeazeve on May 25 2023, 7:34 AM.

Details

Summary

Currently, the method GetAttributeAddressRanges takes a DWARFRangeList as a
parameter, just to immediately clear it. The method also returns the size of
this list. Such an API was obfuscating the intent of the call sites (it's not
clear from the method name what it returns) and it was obfuscating redundant
checks on the size of the list.

This commit refactors the method to return the list and to also make the call
sites use the more explicit IsEmpty method.

Diff Detail

Event Timeline

fdeazeve created this revision.May 25 2023, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2023, 7:34 AM
fdeazeve requested review of this revision.May 25 2023, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2023, 7:34 AM
fdeazeve added reviewers: bulbazord, Restricted Project.May 25 2023, 7:36 AM
This revision is now accepted and ready to land.May 25 2023, 10:06 AM
bulbazord accepted this revision.May 25 2023, 10:23 AM

Thanks for doing this work!

This revision was automatically updated to reflect the committed changes.