[all-commits] [llvm/llvm-project] 47b766: [lldb] Use std::size instead of llvm::array_lengthof

Joseph Loser via All-commits all-commits at lists.llvm.org
Thu Sep 8 13:22:50 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 47b76631e76810bfc6d91d534dc1b095e8058ff4
      https://github.com/llvm/llvm-project/commit/47b76631e76810bfc6d91d534dc1b095e8058ff4
  Author: Joe Loser <joeloser at fastmail.com>
  Date:   2022-09-08 (Thu, 08 Sep 2022)

  Changed paths:
    M lldb/source/DataFormatters/FormatManager.cpp
    M lldb/source/Host/posix/MainLoopPosix.cpp
    M lldb/source/Host/windows/ConnectionGenericFileWindows.cpp
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
    M lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
    M lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
    M lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
    M lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
    M lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
    M lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
    M lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    M lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    M lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
    M lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
    M lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    M lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    M lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    M lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
    M lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
    M lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
    M lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
    M lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.cpp
    M lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
    M lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
    M lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.cpp
    M lldb/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.cpp
    M lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
    M lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
    M lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp
    M lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp
    M lldb/source/Utility/ArchSpec.cpp
    M lldb/unittests/Utility/StatusTest.cpp

  Log Message:
  -----------
  [lldb] Use std::size instead of llvm::array_lengthof

LLVM contains a helpful function for getting the size of a C-style
array: `llvm::array_lengthof`. This is useful prior to C++17, but not as
helpful for C++17 or later: `std::size` already has support for C-style
arrays.

Change call sites to use `std::size` instead.

Differential Revision: https://reviews.llvm.org/D133501




More information about the All-commits mailing list