[RISCV] Reduce redundancy in vnsrl tests
[llvm-project.git] / lldb / source / API / SBProcessInfoList.cpp
bloba711bcb58301e6187aaff578d5d5b8acf380b62d
1 //===-- SBProcessInfoList.cpp ---------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "lldb/API/SBProcessInfoList.h"
10 #include "lldb/API/SBProcessInfo.h"
11 #include "lldb/Utility/Instrumentation.h"
12 #include "lldb/Utility/ProcessInfo.h"
14 #include "Utils.h"
16 using namespace lldb;
17 using namespace lldb_private;
19 SBProcessInfoList::SBProcessInfoList() = default;
21 SBProcessInfoList::~SBProcessInfoList() = default;
23 SBProcessInfoList::SBProcessInfoList(const ProcessInfoList &impl)
24 : m_opaque_up(std::make_unique<ProcessInfoList>(impl)) {
25 LLDB_INSTRUMENT_VA(this, impl);
28 SBProcessInfoList::SBProcessInfoList(const lldb::SBProcessInfoList &rhs) {
30 LLDB_INSTRUMENT_VA(this, rhs);
32 m_opaque_up = clone(rhs.m_opaque_up);
35 const lldb::SBProcessInfoList &
36 SBProcessInfoList::operator=(const lldb::SBProcessInfoList &rhs) {
38 LLDB_INSTRUMENT_VA(this, rhs);
40 if (this != &rhs)
41 m_opaque_up = clone(rhs.m_opaque_up);
42 return *this;
45 uint32_t SBProcessInfoList::GetSize() const {
46 LLDB_INSTRUMENT_VA(this);
48 if (m_opaque_up)
49 return m_opaque_up->GetSize();
51 return 0;
54 void SBProcessInfoList::Clear() {
55 LLDB_INSTRUMENT_VA(this);
57 if (m_opaque_up)
58 m_opaque_up->Clear();
61 bool SBProcessInfoList::GetProcessInfoAtIndex(uint32_t idx,
62 SBProcessInfo &info) {
63 LLDB_INSTRUMENT_VA(this, idx, info);
65 if (m_opaque_up) {
66 lldb_private::ProcessInstanceInfo process_instance_info;
67 if (m_opaque_up->GetProcessInfoAtIndex(idx, process_instance_info)) {
68 info.SetProcessInfo(process_instance_info);
69 return true;
73 return false;