xref: /src/contrib/llvm-project/lldb/source/API/SBStatisticsOptions.cpp (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1ac9a064cSDimitry Andric //===-- SBStatisticsOptions.cpp -------------------------------------------===//
2ac9a064cSDimitry Andric //
3ac9a064cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4ac9a064cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5ac9a064cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6ac9a064cSDimitry Andric //
7ac9a064cSDimitry Andric //===----------------------------------------------------------------------===//
8ac9a064cSDimitry Andric 
9ac9a064cSDimitry Andric #include "lldb/API/SBStatisticsOptions.h"
10ac9a064cSDimitry Andric #include "lldb/Target/Statistics.h"
11ac9a064cSDimitry Andric #include "lldb/Utility/Instrumentation.h"
12ac9a064cSDimitry Andric 
13ac9a064cSDimitry Andric #include "Utils.h"
14ac9a064cSDimitry Andric 
15ac9a064cSDimitry Andric using namespace lldb;
16ac9a064cSDimitry Andric using namespace lldb_private;
17ac9a064cSDimitry Andric 
SBStatisticsOptions()18ac9a064cSDimitry Andric SBStatisticsOptions::SBStatisticsOptions()
19ac9a064cSDimitry Andric     : m_opaque_up(new StatisticsOptions()) {
20ac9a064cSDimitry Andric   LLDB_INSTRUMENT_VA(this);
21ac9a064cSDimitry Andric }
22ac9a064cSDimitry Andric 
SBStatisticsOptions(const SBStatisticsOptions & rhs)23ac9a064cSDimitry Andric SBStatisticsOptions::SBStatisticsOptions(const SBStatisticsOptions &rhs) {
24ac9a064cSDimitry Andric   LLDB_INSTRUMENT_VA(this, rhs);
25ac9a064cSDimitry Andric 
26ac9a064cSDimitry Andric   m_opaque_up = clone(rhs.m_opaque_up);
27ac9a064cSDimitry Andric }
28ac9a064cSDimitry Andric 
29ac9a064cSDimitry Andric SBStatisticsOptions::~SBStatisticsOptions() = default;
30ac9a064cSDimitry Andric 
31ac9a064cSDimitry Andric const SBStatisticsOptions &
operator =(const SBStatisticsOptions & rhs)32ac9a064cSDimitry Andric SBStatisticsOptions::operator=(const SBStatisticsOptions &rhs) {
33ac9a064cSDimitry Andric   LLDB_INSTRUMENT_VA(this, rhs);
34ac9a064cSDimitry Andric 
35ac9a064cSDimitry Andric   if (this != &rhs)
36ac9a064cSDimitry Andric     m_opaque_up = clone(rhs.m_opaque_up);
37ac9a064cSDimitry Andric   return *this;
38ac9a064cSDimitry Andric }
39ac9a064cSDimitry Andric 
SetSummaryOnly(bool b)40ac9a064cSDimitry Andric void SBStatisticsOptions::SetSummaryOnly(bool b) {
41ac9a064cSDimitry Andric   m_opaque_up->SetSummaryOnly(b);
42ac9a064cSDimitry Andric }
43ac9a064cSDimitry Andric 
GetSummaryOnly()44ac9a064cSDimitry Andric bool SBStatisticsOptions::GetSummaryOnly() {
45ac9a064cSDimitry Andric   return m_opaque_up->GetSummaryOnly();
46ac9a064cSDimitry Andric }
47ac9a064cSDimitry Andric 
SetIncludeTargets(bool b)48ac9a064cSDimitry Andric void SBStatisticsOptions::SetIncludeTargets(bool b) {
49ac9a064cSDimitry Andric   m_opaque_up->SetIncludeTargets(b);
50ac9a064cSDimitry Andric }
51ac9a064cSDimitry Andric 
GetIncludeTargets() const52ac9a064cSDimitry Andric bool SBStatisticsOptions::GetIncludeTargets() const {
53ac9a064cSDimitry Andric   return m_opaque_up->GetIncludeTargets();
54ac9a064cSDimitry Andric }
55ac9a064cSDimitry Andric 
SetIncludeModules(bool b)56ac9a064cSDimitry Andric void SBStatisticsOptions::SetIncludeModules(bool b) {
57ac9a064cSDimitry Andric   m_opaque_up->SetIncludeModules(b);
58ac9a064cSDimitry Andric }
59ac9a064cSDimitry Andric 
GetIncludeModules() const60ac9a064cSDimitry Andric bool SBStatisticsOptions::GetIncludeModules() const {
61ac9a064cSDimitry Andric   return m_opaque_up->GetIncludeModules();
62ac9a064cSDimitry Andric }
63ac9a064cSDimitry Andric 
SetIncludeTranscript(bool b)64ac9a064cSDimitry Andric void SBStatisticsOptions::SetIncludeTranscript(bool b) {
65ac9a064cSDimitry Andric   m_opaque_up->SetIncludeTranscript(b);
66ac9a064cSDimitry Andric }
67ac9a064cSDimitry Andric 
GetIncludeTranscript() const68ac9a064cSDimitry Andric bool SBStatisticsOptions::GetIncludeTranscript() const {
69ac9a064cSDimitry Andric   return m_opaque_up->GetIncludeTranscript();
70ac9a064cSDimitry Andric }
71ac9a064cSDimitry Andric 
SetReportAllAvailableDebugInfo(bool b)72ac9a064cSDimitry Andric void SBStatisticsOptions::SetReportAllAvailableDebugInfo(bool b) {
73ac9a064cSDimitry Andric   m_opaque_up->SetLoadAllDebugInfo(b);
74ac9a064cSDimitry Andric }
75ac9a064cSDimitry Andric 
GetReportAllAvailableDebugInfo()76ac9a064cSDimitry Andric bool SBStatisticsOptions::GetReportAllAvailableDebugInfo() {
77ac9a064cSDimitry Andric   return m_opaque_up->GetLoadAllDebugInfo();
78ac9a064cSDimitry Andric }
79ac9a064cSDimitry Andric 
ref() const80ac9a064cSDimitry Andric const lldb_private::StatisticsOptions &SBStatisticsOptions::ref() const {
81ac9a064cSDimitry Andric   return *m_opaque_up;
82ac9a064cSDimitry Andric }
83