1 | //===-- SBStatisticsOptions.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 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "lldb/API/SBStatisticsOptions.h" |
10 | #include "lldb/Target/Statistics.h" |
11 | #include "lldb/Utility/Instrumentation.h" |
12 | |
13 | #include "Utils.h" |
14 | |
15 | using namespace lldb; |
16 | using namespace lldb_private; |
17 | |
18 | SBStatisticsOptions::SBStatisticsOptions() |
19 | : m_opaque_up(new StatisticsOptions()) { |
20 | LLDB_INSTRUMENT_VA(this); |
21 | m_opaque_up->summary_only = false; |
22 | } |
23 | |
24 | SBStatisticsOptions::SBStatisticsOptions(const SBStatisticsOptions &rhs) { |
25 | LLDB_INSTRUMENT_VA(this, rhs); |
26 | |
27 | m_opaque_up = clone(src: rhs.m_opaque_up); |
28 | } |
29 | |
30 | SBStatisticsOptions::~SBStatisticsOptions() = default; |
31 | |
32 | const SBStatisticsOptions & |
33 | SBStatisticsOptions::operator=(const SBStatisticsOptions &rhs) { |
34 | LLDB_INSTRUMENT_VA(this, rhs); |
35 | |
36 | if (this != &rhs) |
37 | m_opaque_up = clone(src: rhs.m_opaque_up); |
38 | return *this; |
39 | } |
40 | |
41 | void SBStatisticsOptions::SetSummaryOnly(bool b) { |
42 | m_opaque_up->summary_only = b; |
43 | } |
44 | |
45 | bool SBStatisticsOptions::GetSummaryOnly() { return m_opaque_up->summary_only; } |
46 | |
47 | void SBStatisticsOptions::SetReportAllAvailableDebugInfo(bool b) { |
48 | m_opaque_up->load_all_debug_info = b; |
49 | } |
50 | |
51 | bool SBStatisticsOptions::GetReportAllAvailableDebugInfo() { |
52 | return m_opaque_up->load_all_debug_info; |
53 | } |
54 | |
55 | const lldb_private::StatisticsOptions &SBStatisticsOptions::ref() const { |
56 | return *m_opaque_up; |
57 | } |
58 |