[lldb][nfc] Refactor methods with out parameter
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>
Thu, 25 May 2023 11:24:30 +0000 (07:24 -0400)
committerFelipe de Azevedo Piovezan <fpiovezan@apple.com>
Thu, 25 May 2023 17:38:35 +0000 (13:38 -0400)
commit346afb8572280292139c22a00f80afbbfdb509f6
tree77025a686b42950a2eae9c83c7153befd9e5edcc
parent150470a055d5c23b92de3f9110e5fd553aef19a0
[lldb][nfc] Refactor methods with out parameter

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.

Differential Revision: https://reviews.llvm.org/D151451
lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp