[all-commits] [llvm/llvm-project] 346afb: [lldb][nfc] Refactor methods with out parameter

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Thu May 25 10:38:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 346afb8572280292139c22a00f80afbbfdb509f6
      https://github.com/llvm/llvm-project/commit/346afb8572280292139c22a00f80afbbfdb509f6
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list