This is an archive of the discontinued LLVM Phabricator instance.

[lldb][nfc] Simplify DebugRanges class
ClosedPublic

Authored by fdeazeve on May 11 2023, 6:53 AM.

Details

Reviewers
rastogishubham
bulbazord
Group Reviewers
Restricted Project
Commits
rG81be68062f49: [lldb][nfc] Simplify DebugRanges class
Summary

Most of the code changed here dates back to 2010, when LLDB was first
introduced upstream, as such it benefits from a slight cleanup.

The method "dump" is not used anywhere nor is it tested, so this commit removes
it.

The "findRanges" method returns a boolean which is never checked and indicates
whether the method found anything/assigned a range map to the out parameter.
This commit folds the out parameter into the return type of the method.

A handful of typedefs were also never used and therefore removed.

Diff Detail

Event Timeline

fdeazeve created this revision.May 11 2023, 6:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 6:53 AM
fdeazeve requested review of this revision.May 11 2023, 6:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 6:53 AM
fdeazeve added a reviewer: Restricted Project.May 11 2023, 6:54 AM
rastogishubham accepted this revision.May 11 2023, 9:47 AM
rastogishubham added a subscriber: rastogishubham.
rastogishubham added inline comments.
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
32

Any reason why the name was changed to m_range_map?

This revision is now accepted and ready to land.May 11 2023, 9:47 AM
fdeazeve added inline comments.May 11 2023, 9:50 AM
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
32

It was also m_range_map before. Maybe you're confusing it with name of the typedef that got deleted? The diff highlighting here is misleading

bulbazord accepted this revision.May 11 2023, 10:26 AM
bulbazord added a subscriber: bulbazord.

LGTM! I know we have this pattern in many places in LLDB. It's good to see this work being done.

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
32

Yes you are right, I got a bit confused there, sorry

This revision was automatically updated to reflect the committed changes.