]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/API/SBVariablesOptions.cpp
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304659, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / API / SBVariablesOptions.cpp
1 //===-- SBVariablesOptions.cpp --------------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #include "lldb/API/SBVariablesOptions.h"
12
13 using namespace lldb;
14 using namespace lldb_private;
15
16 class VariablesOptionsImpl {
17 public:
18   VariablesOptionsImpl()
19       : m_include_arguments(false), m_include_locals(false),
20         m_include_statics(false), m_in_scope_only(false),
21         m_include_runtime_support_values(false),
22         m_use_dynamic(lldb::eNoDynamicValues) {}
23
24   VariablesOptionsImpl(const VariablesOptionsImpl &) = default;
25
26   ~VariablesOptionsImpl() = default;
27
28   VariablesOptionsImpl &operator=(const VariablesOptionsImpl &) = default;
29
30   bool GetIncludeArguments() const { return m_include_arguments; }
31
32   void SetIncludeArguments(bool b) { m_include_arguments = b; }
33
34   bool GetIncludeLocals() const { return m_include_locals; }
35
36   void SetIncludeLocals(bool b) { m_include_locals = b; }
37
38   bool GetIncludeStatics() const { return m_include_statics; }
39
40   void SetIncludeStatics(bool b) { m_include_statics = b; }
41
42   bool GetInScopeOnly() const { return m_in_scope_only; }
43
44   void SetInScopeOnly(bool b) { m_in_scope_only = b; }
45
46   bool GetIncludeRuntimeSupportValues() const {
47     return m_include_runtime_support_values;
48   }
49
50   void SetIncludeRuntimeSupportValues(bool b) {
51     m_include_runtime_support_values = b;
52   }
53
54   lldb::DynamicValueType GetUseDynamic() const { return m_use_dynamic; }
55
56   void SetUseDynamic(lldb::DynamicValueType d) { m_use_dynamic = d; }
57
58 private:
59   bool m_include_arguments : 1;
60   bool m_include_locals : 1;
61   bool m_include_statics : 1;
62   bool m_in_scope_only : 1;
63   bool m_include_runtime_support_values : 1;
64   lldb::DynamicValueType m_use_dynamic;
65 };
66
67 SBVariablesOptions::SBVariablesOptions()
68     : m_opaque_ap(new VariablesOptionsImpl()) {}
69
70 SBVariablesOptions::SBVariablesOptions(const SBVariablesOptions &options)
71     : m_opaque_ap(new VariablesOptionsImpl(options.ref())) {}
72
73 SBVariablesOptions &SBVariablesOptions::
74 operator=(const SBVariablesOptions &options) {
75   m_opaque_ap.reset(new VariablesOptionsImpl(options.ref()));
76   return *this;
77 }
78
79 SBVariablesOptions::~SBVariablesOptions() = default;
80
81 bool SBVariablesOptions::IsValid() const {
82   return m_opaque_ap.get() != nullptr;
83 }
84
85 bool SBVariablesOptions::GetIncludeArguments() const {
86   return m_opaque_ap->GetIncludeArguments();
87 }
88
89 void SBVariablesOptions::SetIncludeArguments(bool arguments) {
90   m_opaque_ap->SetIncludeArguments(arguments);
91 }
92
93 bool SBVariablesOptions::GetIncludeLocals() const {
94   return m_opaque_ap->GetIncludeLocals();
95 }
96
97 void SBVariablesOptions::SetIncludeLocals(bool locals) {
98   m_opaque_ap->SetIncludeLocals(locals);
99 }
100
101 bool SBVariablesOptions::GetIncludeStatics() const {
102   return m_opaque_ap->GetIncludeStatics();
103 }
104
105 void SBVariablesOptions::SetIncludeStatics(bool statics) {
106   m_opaque_ap->SetIncludeStatics(statics);
107 }
108
109 bool SBVariablesOptions::GetInScopeOnly() const {
110   return m_opaque_ap->GetInScopeOnly();
111 }
112
113 void SBVariablesOptions::SetInScopeOnly(bool in_scope_only) {
114   m_opaque_ap->SetInScopeOnly(in_scope_only);
115 }
116
117 bool SBVariablesOptions::GetIncludeRuntimeSupportValues() const {
118   return m_opaque_ap->GetIncludeRuntimeSupportValues();
119 }
120
121 void SBVariablesOptions::SetIncludeRuntimeSupportValues(
122     bool runtime_support_values) {
123   m_opaque_ap->SetIncludeRuntimeSupportValues(runtime_support_values);
124 }
125
126 lldb::DynamicValueType SBVariablesOptions::GetUseDynamic() const {
127   return m_opaque_ap->GetUseDynamic();
128 }
129
130 void SBVariablesOptions::SetUseDynamic(lldb::DynamicValueType dynamic) {
131   m_opaque_ap->SetUseDynamic(dynamic);
132 }
133
134 VariablesOptionsImpl *SBVariablesOptions::operator->() {
135   return m_opaque_ap.operator->();
136 }
137
138 const VariablesOptionsImpl *SBVariablesOptions::operator->() const {
139   return m_opaque_ap.operator->();
140 }
141
142 VariablesOptionsImpl *SBVariablesOptions::get() { return m_opaque_ap.get(); }
143
144 VariablesOptionsImpl &SBVariablesOptions::ref() { return *m_opaque_ap; }
145
146 const VariablesOptionsImpl &SBVariablesOptions::ref() const {
147   return *m_opaque_ap;
148 }
149
150 SBVariablesOptions::SBVariablesOptions(VariablesOptionsImpl *lldb_object_ptr)
151     : m_opaque_ap(std::move(lldb_object_ptr)) {}
152
153 void SBVariablesOptions::SetOptions(VariablesOptionsImpl *lldb_object_ptr) {
154   m_opaque_ap.reset(std::move(lldb_object_ptr));
155 }