[all-commits] [llvm/llvm-project] 669e57: [lldb] Simplify specifying of platform supported a...

Pavel Labath via All-commits all-commits at lists.llvm.org
Tue Nov 16 02:48:06 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 669e57ebd1a7137aba7aab47d9d4dd67e1b0b9a0
      https://github.com/llvm/llvm-project/commit/669e57ebd1a7137aba7aab47d9d4dd67e1b0b9a0
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2021-11-16 (Tue, 16 Nov 2021)

  Changed paths:
    M lldb/include/lldb/Target/Platform.h
    M lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    M lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
    M lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
    M lldb/source/Plugins/Platform/Linux/PlatformLinux.h
    M lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
    M lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h
    M lldb/source/Target/Platform.cpp

  Log Message:
  -----------
  [lldb] Simplify specifying of platform supported architectures

The GetSupportedArchitectureAtIndex pattern forces the use of
complicated patterns in both the implementations of the function and in
the various callers.

This patch creates a new method (GetSupportedArchitectures), which
returns a list (vector) of architectures. The
GetSupportedArchitectureAtIndex is kept in order to enable incremental
rollout. Base Platform class contains implementations of both of these
methods, using the other method as the source of truth. Platforms
without infinite stacks should implement at least one of them.

This patch also ports Linux, FreeBSD and NetBSD platforms to the new
API. A new helper function (CreateArchList) is added to simplify the
common task of creating a list of ArchSpecs with the same OS but
different architectures.

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




More information about the All-commits mailing list