1 //===-- SBType.h ------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBType_h_
11 #define LLDB_SBType_h_
13 #include "lldb/API/SBDefines.h"
19 class LLDB_API SBTypeMember {
23 SBTypeMember(const lldb::SBTypeMember &rhs);
27 lldb::SBTypeMember &operator=(const lldb::SBTypeMember &rhs);
31 const char *GetName();
33 lldb::SBType GetType();
35 uint64_t GetOffsetInBytes();
37 uint64_t GetOffsetInBits();
41 uint32_t GetBitfieldSizeInBits();
43 bool GetDescription(lldb::SBStream &description,
44 lldb::DescriptionLevel description_level);
49 void reset(lldb_private::TypeMemberImpl *);
51 lldb_private::TypeMemberImpl &ref();
53 const lldb_private::TypeMemberImpl &ref() const;
55 std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
58 class SBTypeMemberFunction {
60 SBTypeMemberFunction();
62 SBTypeMemberFunction(const lldb::SBTypeMemberFunction &rhs);
64 ~SBTypeMemberFunction();
66 lldb::SBTypeMemberFunction &operator=(const lldb::SBTypeMemberFunction &rhs);
70 const char *GetName();
72 const char *GetDemangledName();
74 const char *GetMangledName();
76 lldb::SBType GetType();
78 lldb::SBType GetReturnType();
80 uint32_t GetNumberOfArguments();
82 lldb::SBType GetArgumentTypeAtIndex(uint32_t);
84 lldb::MemberFunctionKind GetKind();
86 bool GetDescription(lldb::SBStream &description,
87 lldb::DescriptionLevel description_level);
92 void reset(lldb_private::TypeMemberFunctionImpl *);
94 lldb_private::TypeMemberFunctionImpl &ref();
96 const lldb_private::TypeMemberFunctionImpl &ref() const;
98 lldb::TypeMemberFunctionImplSP m_opaque_sp;
105 SBType(const lldb::SBType &rhs);
109 bool IsValid() const;
111 uint64_t GetByteSize();
113 bool IsPointerType();
115 bool IsReferenceType();
117 bool IsFunctionType();
119 bool IsPolymorphicClass();
125 bool IsTypedefType();
127 bool IsAnonymousType();
129 lldb::SBType GetPointerType();
131 lldb::SBType GetPointeeType();
133 lldb::SBType GetReferenceType();
135 lldb::SBType GetTypedefedType();
137 lldb::SBType GetDereferencedType();
139 lldb::SBType GetUnqualifiedType();
141 lldb::SBType GetArrayElementType();
143 lldb::SBType GetArrayType(uint64_t size);
145 lldb::SBType GetVectorElementType();
147 lldb::SBType GetCanonicalType();
148 // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
149 // type eBasicTypeInvalid will be returned
150 lldb::BasicType GetBasicType();
152 // The call below confusing and should really be renamed to "CreateBasicType"
153 lldb::SBType GetBasicType(lldb::BasicType type);
155 uint32_t GetNumberOfFields();
157 uint32_t GetNumberOfDirectBaseClasses();
159 uint32_t GetNumberOfVirtualBaseClasses();
161 lldb::SBTypeMember GetFieldAtIndex(uint32_t idx);
163 lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx);
165 lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx);
167 lldb::SBTypeEnumMemberList GetEnumMembers();
169 uint32_t GetNumberOfTemplateArguments();
171 lldb::SBType GetTemplateArgumentType(uint32_t idx);
173 lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx);
175 lldb::SBType GetFunctionReturnType();
177 lldb::SBTypeList GetFunctionArgumentTypes();
179 uint32_t GetNumberOfMemberFunctions();
181 lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx);
183 const char *GetName();
185 const char *GetDisplayTypeName();
187 lldb::TypeClass GetTypeClass();
189 bool IsTypeComplete();
191 uint32_t GetTypeFlags();
193 bool GetDescription(lldb::SBStream &description,
194 lldb::DescriptionLevel description_level);
196 lldb::SBType &operator=(const lldb::SBType &rhs);
198 bool operator==(lldb::SBType &rhs);
200 bool operator!=(lldb::SBType &rhs);
203 lldb_private::TypeImpl &ref();
205 const lldb_private::TypeImpl &ref() const;
207 lldb::TypeImplSP GetSP();
209 void SetSP(const lldb::TypeImplSP &type_impl_sp);
211 lldb::TypeImplSP m_opaque_sp;
213 friend class SBFunction;
214 friend class SBModule;
215 friend class SBTarget;
216 friend class SBTypeEnumMember;
217 friend class SBTypeEnumMemberList;
218 friend class SBTypeNameSpecifier;
219 friend class SBTypeMember;
220 friend class SBTypeMemberFunction;
221 friend class SBTypeList;
222 friend class SBValue;
224 SBType(const lldb_private::CompilerType &);
225 SBType(const lldb::TypeSP &);
226 SBType(const lldb::TypeImplSP &);
233 SBTypeList(const lldb::SBTypeList &rhs);
237 lldb::SBTypeList &operator=(const lldb::SBTypeList &rhs);
241 void Append(lldb::SBType type);
243 lldb::SBType GetTypeAtIndex(uint32_t index);
248 std::unique_ptr<lldb_private::TypeListImpl> m_opaque_ap;
249 friend class SBModule;
250 friend class SBCompileUnit;
255 #endif // LLDB_SBType_h_