xref: /freebsd/contrib/llvm-project/lldb/source/API/SBStatisticsOptions.cpp (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
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 
SBStatisticsOptions()18 SBStatisticsOptions::SBStatisticsOptions()
19     : m_opaque_up(new StatisticsOptions()) {
20   LLDB_INSTRUMENT_VA(this);
21 }
22 
SBStatisticsOptions(const SBStatisticsOptions & rhs)23 SBStatisticsOptions::SBStatisticsOptions(const SBStatisticsOptions &rhs) {
24   LLDB_INSTRUMENT_VA(this, rhs);
25 
26   m_opaque_up = clone(rhs.m_opaque_up);
27 }
28 
29 SBStatisticsOptions::~SBStatisticsOptions() = default;
30 
31 const SBStatisticsOptions &
operator =(const SBStatisticsOptions & rhs)32 SBStatisticsOptions::operator=(const SBStatisticsOptions &rhs) {
33   LLDB_INSTRUMENT_VA(this, rhs);
34 
35   if (this != &rhs)
36     m_opaque_up = clone(rhs.m_opaque_up);
37   return *this;
38 }
39 
SetSummaryOnly(bool b)40 void SBStatisticsOptions::SetSummaryOnly(bool b) {
41   m_opaque_up->SetSummaryOnly(b);
42 }
43 
GetSummaryOnly()44 bool SBStatisticsOptions::GetSummaryOnly() {
45   return m_opaque_up->GetSummaryOnly();
46 }
47 
SetIncludeTargets(bool b)48 void SBStatisticsOptions::SetIncludeTargets(bool b) {
49   m_opaque_up->SetIncludeTargets(b);
50 }
51 
GetIncludeTargets() const52 bool SBStatisticsOptions::GetIncludeTargets() const {
53   return m_opaque_up->GetIncludeTargets();
54 }
55 
SetIncludeModules(bool b)56 void SBStatisticsOptions::SetIncludeModules(bool b) {
57   m_opaque_up->SetIncludeModules(b);
58 }
59 
GetIncludeModules() const60 bool SBStatisticsOptions::GetIncludeModules() const {
61   return m_opaque_up->GetIncludeModules();
62 }
63 
SetIncludeTranscript(bool b)64 void SBStatisticsOptions::SetIncludeTranscript(bool b) {
65   m_opaque_up->SetIncludeTranscript(b);
66 }
67 
GetIncludeTranscript() const68 bool SBStatisticsOptions::GetIncludeTranscript() const {
69   return m_opaque_up->GetIncludeTranscript();
70 }
71 
SetReportAllAvailableDebugInfo(bool b)72 void SBStatisticsOptions::SetReportAllAvailableDebugInfo(bool b) {
73   m_opaque_up->SetLoadAllDebugInfo(b);
74 }
75 
GetReportAllAvailableDebugInfo()76 bool SBStatisticsOptions::GetReportAllAvailableDebugInfo() {
77   return m_opaque_up->GetLoadAllDebugInfo();
78 }
79 
ref() const80 const lldb_private::StatisticsOptions &SBStatisticsOptions::ref() const {
81   return *m_opaque_up;
82 }
83