LLDB mainline
SBType.h
Go to the documentation of this file.
1//===-- SBType.h ------------------------------------------------*- C++ -*-===//
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#ifndef LLDB_API_SBTYPE_H
10#define LLDB_API_SBTYPE_H
11
12#include "lldb/API/SBDefines.h"
13
14namespace lldb {
15
16class SBTypeList;
17
19public:
21
23
25
26 lldb::SBTypeMember &operator=(const lldb::SBTypeMember &rhs);
27
28 explicit operator bool() const;
29
30 bool IsValid() const;
31
32 const char *GetName();
33
34 lldb::SBType GetType();
35
36 uint64_t GetOffsetInBytes();
37
38 uint64_t GetOffsetInBits();
39
40 bool IsBitfield();
41
42 uint32_t GetBitfieldSizeInBits();
43
44 bool GetDescription(lldb::SBStream &description,
45 lldb::DescriptionLevel description_level);
46
47protected:
48 friend class SBType;
49
50 void reset(lldb_private::TypeMemberImpl *);
51
53
54 const lldb_private::TypeMemberImpl &ref() const;
55
56 std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_up;
57};
58
60public:
62
64
66
68
69 explicit operator bool() const;
70
71 bool IsValid() const;
72
73 const char *GetName();
74
75 const char *GetDemangledName();
76
77 const char *GetMangledName();
78
80
82
84
86
88
89 bool GetDescription(lldb::SBStream &description,
90 lldb::DescriptionLevel description_level);
91
92protected:
93 friend class SBType;
94
96
98
100
101 lldb::TypeMemberFunctionImplSP m_opaque_sp;
102};
103
104class SBType {
105public:
106 SBType();
107
108 SBType(const lldb::SBType &rhs);
109#ifndef SWIG
110 SBType(const lldb::TypeImplSP &);
111#endif
112
114
115 explicit operator bool() const;
116
117 bool IsValid() const;
118
119 uint64_t GetByteSize();
120
121 bool IsPointerType();
122
123 bool IsReferenceType();
124
125 bool IsFunctionType();
126
127 bool IsPolymorphicClass();
128
129 bool IsArrayType();
130
131 bool IsVectorType();
132
133 bool IsTypedefType();
134
135 bool IsAnonymousType();
136
138
139 bool IsAggregateType();
140
142
144
146
148
150
152
154
155 lldb::SBType GetArrayType(uint64_t size);
156
158
160
162
163 // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
164 // type eBasicTypeInvalid will be returned
166
167 // The call below confusing and should really be renamed to "CreateBasicType"
169
171
173
175
177
179
181
183
185
187
188 /// Return the TemplateArgumentKind of the template argument at index idx.
189 /// Variadic argument packs are automatically expanded.
191
193
195
197
199
201
202 const char *GetName();
203
204 const char *GetDisplayTypeName();
205
206 lldb::TypeClass GetTypeClass();
207
208 bool IsTypeComplete();
209
211
212 bool GetDescription(lldb::SBStream &description,
213 lldb::DescriptionLevel description_level);
214
216
217 bool operator==(lldb::SBType &rhs);
218
219 bool operator!=(lldb::SBType &rhs);
220
221protected:
223
224 const lldb_private::TypeImpl &ref() const;
225
226 lldb::TypeImplSP GetSP();
227
228 void SetSP(const lldb::TypeImplSP &type_impl_sp);
229
230 lldb::TypeImplSP m_opaque_sp;
231
232 friend class SBFunction;
233 friend class SBModule;
234 friend class SBTarget;
235 friend class SBTypeEnumMember;
238 friend class SBTypeMember;
240 friend class SBTypeList;
241 friend class SBValue;
242 friend class SBWatchpoint;
243
245 SBType(const lldb::TypeSP &);
246};
247
249public:
250 SBTypeList();
251
252 SBTypeList(const lldb::SBTypeList &rhs);
253
255
257
258 explicit operator bool() const;
259
260 bool IsValid();
261
262 void Append(lldb::SBType type);
263
265
267
268private:
269 std::unique_ptr<lldb_private::TypeListImpl> m_opaque_up;
270 friend class SBModule;
271 friend class SBCompileUnit;
272};
273
274} // namespace lldb
275
276#endif // LLDB_API_SBTYPE_H
#define LLDB_API
Definition: SBDefines.h:26
static llvm::StringRef GetName(XcodeSDK::Type type)
Definition: XcodeSDK.cpp:21
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition: SBType.h:269
lldb::SBType GetTypeAtIndex(uint32_t index)
Definition: SBType.cpp:631
uint32_t GetSize()
Definition: SBType.cpp:639
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
Definition: SBType.cpp:612
bool IsValid()
Definition: SBType.cpp:602
void Append(lldb::SBType type)
Definition: SBType.cpp:624
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
Definition: SBType.cpp:858
const char * GetMangledName()
Definition: SBType.cpp:822
void reset(lldb_private::TypeMemberFunctionImpl *)
Definition: SBType.cpp:889
lldb::MemberFunctionKind GetKind()
Definition: SBType.cpp:869
lldb::SBType GetReturnType()
Definition: SBType.cpp:840
const char * GetName()
Definition: SBType.cpp:801
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
Definition: SBType.cpp:783
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:877
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:101
uint32_t GetNumberOfArguments()
Definition: SBType.cpp:850
lldb::SBType GetType()
Definition: SBType.cpp:830
const char * GetDemangledName()
Definition: SBType.cpp:809
lldb_private::TypeMemberFunctionImpl & ref()
Definition: SBType.cpp:893
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
Definition: SBType.h:56
bool IsArrayType()
Definition: SBType.cpp:138
uint32_t GetNumberOfTemplateArguments()
Definition: SBType.cpp:545
uint32_t GetNumberOfDirectBaseClasses()
Definition: SBType.cpp:371
lldb::SBType GetReferenceType()
Definition: SBType.cpp:180
lldb::SBType GetArrayType(uint64_t size)
Definition: SBType.cpp:213
lldb::SBType GetVectorElementType()
Definition: SBType.cpp:222
uint32_t GetNumberOfFields()
Definition: SBType.cpp:387
lldb::SBType GetDereferencedType()
Definition: SBType.cpp:196
lldb::SBModule GetModule()
Definition: SBType.cpp:510
lldb::BasicType GetBasicType()
Definition: SBType.cpp:354
bool IsPolymorphicClass()
Definition: SBType.cpp:243
uint32_t GetTypeFlags()
Definition: SBType.cpp:502
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:76
bool IsAggregateType()
Definition: SBType.cpp:275
bool IsReferenceType()
Definition: SBType.cpp:155
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:409
bool IsVectorType()
Definition: SBType.cpp:147
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Return the TemplateArgumentKind of the template argument at index idx.
Definition: SBType.cpp:580
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
Definition: SBType.cpp:318
lldb::SBType GetPointerType()
Definition: SBType.cpp:163
uint32_t GetNumberOfMemberFunctions()
Definition: SBType.cpp:309
lldb::SBType GetTemplateArgumentType(uint32_t idx)
Definition: SBType.cpp:554
lldb::TypeClass GetTypeClass()
Definition: SBType.cpp:537
lldb::SBType GetCanonicalType()
Definition: SBType.cpp:336
bool operator!=(lldb::SBType &rhs)
Definition: SBType.cpp:64
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:395
lldb::SBTypeList GetFunctionArgumentTypes()
Definition: SBType.cpp:295
uint32_t GetNumberOfVirtualBaseClasses()
Definition: SBType.cpp:379
lldb::SBType GetTypedefedType()
Definition: SBType.cpp:188
lldb_private::TypeImpl & ref()
Definition: SBType.cpp:93
lldb::SBType & operator=(const lldb::SBType &rhs)
Definition: SBType.cpp:82
lldb::SBType GetFunctionReturnType()
Definition: SBType.cpp:283
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:230
lldb::SBType GetUnqualifiedType()
Definition: SBType.cpp:328
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:425
bool IsTypeComplete()
Definition: SBType.cpp:489
const char * GetDisplayTypeName()
Definition: SBType.cpp:529
lldb::SBType GetArrayElementType()
Definition: SBType.cpp:204
bool IsTypedefType()
Definition: SBType.cpp:251
bool IsAnonymousType()
Definition: SBType.cpp:259
bool IsPointerType()
Definition: SBType.cpp:130
const char * GetName()
Definition: SBType.cpp:521
lldb::SBType GetPointeeType()
Definition: SBType.cpp:172
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
Definition: SBType.cpp:463
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:78
uint64_t GetByteSize()
Definition: SBType.cpp:120
bool IsValid() const
Definition: SBType.cpp:107
bool operator==(lldb::SBType &rhs)
Definition: SBType.cpp:52
lldb::SBType GetEnumerationIntegerType()
Definition: SBType.cpp:344
lldb::SBTypeEnumMemberList GetEnumMembers()
Definition: SBType.cpp:441
bool IsFunctionType()
Definition: SBType.cpp:235
bool IsScopedEnumerationType()
Definition: SBType.cpp:267
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
Definition: SBAddress.h:15
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
MemberFunctionKind
Kind of member function.
class LLDB_API SBTypeList
Definition: SBDefines.h:103