1 //===-- SBType.h ------------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
10 #define LLDB_SBType_h_
12 #include "lldb/API/SBDefines.h"
18 class LLDB_API SBTypeMember {
22 SBTypeMember(const lldb::SBTypeMember &rhs);
26 lldb::SBTypeMember &operator=(const lldb::SBTypeMember &rhs);
28 explicit operator bool() const;
32 const char *GetName();
34 lldb::SBType GetType();
36 uint64_t GetOffsetInBytes();
38 uint64_t GetOffsetInBits();
42 uint32_t GetBitfieldSizeInBits();
44 bool GetDescription(lldb::SBStream &description,
45 lldb::DescriptionLevel description_level);
50 void reset(lldb_private::TypeMemberImpl *);
52 lldb_private::TypeMemberImpl &ref();
54 const lldb_private::TypeMemberImpl &ref() const;
56 std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_up;
59 class SBTypeMemberFunction {
61 SBTypeMemberFunction();
63 SBTypeMemberFunction(const lldb::SBTypeMemberFunction &rhs);
65 ~SBTypeMemberFunction();
67 lldb::SBTypeMemberFunction &operator=(const lldb::SBTypeMemberFunction &rhs);
69 explicit operator bool() const;
73 const char *GetName();
75 const char *GetDemangledName();
77 const char *GetMangledName();
79 lldb::SBType GetType();
81 lldb::SBType GetReturnType();
83 uint32_t GetNumberOfArguments();
85 lldb::SBType GetArgumentTypeAtIndex(uint32_t);
87 lldb::MemberFunctionKind GetKind();
89 bool GetDescription(lldb::SBStream &description,
90 lldb::DescriptionLevel description_level);
95 void reset(lldb_private::TypeMemberFunctionImpl *);
97 lldb_private::TypeMemberFunctionImpl &ref();
99 const lldb_private::TypeMemberFunctionImpl &ref() const;
101 lldb::TypeMemberFunctionImplSP m_opaque_sp;
108 SBType(const lldb::SBType &rhs);
112 explicit operator bool() const;
114 bool IsValid() const;
116 uint64_t GetByteSize();
118 bool IsPointerType();
120 bool IsReferenceType();
122 bool IsFunctionType();
124 bool IsPolymorphicClass();
130 bool IsTypedefType();
132 bool IsAnonymousType();
134 lldb::SBType GetPointerType();
136 lldb::SBType GetPointeeType();
138 lldb::SBType GetReferenceType();
140 lldb::SBType GetTypedefedType();
142 lldb::SBType GetDereferencedType();
144 lldb::SBType GetUnqualifiedType();
146 lldb::SBType GetArrayElementType();
148 lldb::SBType GetArrayType(uint64_t size);
150 lldb::SBType GetVectorElementType();
152 lldb::SBType GetCanonicalType();
153 // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
154 // type eBasicTypeInvalid will be returned
155 lldb::BasicType GetBasicType();
157 // The call below confusing and should really be renamed to "CreateBasicType"
158 lldb::SBType GetBasicType(lldb::BasicType type);
160 uint32_t GetNumberOfFields();
162 uint32_t GetNumberOfDirectBaseClasses();
164 uint32_t GetNumberOfVirtualBaseClasses();
166 lldb::SBTypeMember GetFieldAtIndex(uint32_t idx);
168 lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx);
170 lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx);
172 lldb::SBTypeEnumMemberList GetEnumMembers();
174 uint32_t GetNumberOfTemplateArguments();
176 lldb::SBType GetTemplateArgumentType(uint32_t idx);
178 lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx);
180 lldb::SBType GetFunctionReturnType();
182 lldb::SBTypeList GetFunctionArgumentTypes();
184 uint32_t GetNumberOfMemberFunctions();
186 lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx);
188 const char *GetName();
190 const char *GetDisplayTypeName();
192 lldb::TypeClass GetTypeClass();
194 bool IsTypeComplete();
196 uint32_t GetTypeFlags();
198 bool GetDescription(lldb::SBStream &description,
199 lldb::DescriptionLevel description_level);
201 lldb::SBType &operator=(const lldb::SBType &rhs);
203 bool operator==(lldb::SBType &rhs);
205 bool operator!=(lldb::SBType &rhs);
208 lldb_private::TypeImpl &ref();
210 const lldb_private::TypeImpl &ref() const;
212 lldb::TypeImplSP GetSP();
214 void SetSP(const lldb::TypeImplSP &type_impl_sp);
216 lldb::TypeImplSP m_opaque_sp;
218 friend class SBFunction;
219 friend class SBModule;
220 friend class SBTarget;
221 friend class SBTypeEnumMember;
222 friend class SBTypeEnumMemberList;
223 friend class SBTypeNameSpecifier;
224 friend class SBTypeMember;
225 friend class SBTypeMemberFunction;
226 friend class SBTypeList;
227 friend class SBValue;
229 SBType(const lldb_private::CompilerType &);
230 SBType(const lldb::TypeSP &);
231 SBType(const lldb::TypeImplSP &);
238 SBTypeList(const lldb::SBTypeList &rhs);
242 lldb::SBTypeList &operator=(const lldb::SBTypeList &rhs);
244 explicit operator bool() const;
248 void Append(lldb::SBType type);
250 lldb::SBType GetTypeAtIndex(uint32_t index);
255 std::unique_ptr<lldb_private::TypeListImpl> m_opaque_up;
256 friend class SBModule;
257 friend class SBCompileUnit;
262 #endif // LLDB_SBType_h_