Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:43

0001 //===-- SBType.h ------------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBTYPE_H
0010 #define LLDB_API_SBTYPE_H
0011 
0012 #include "lldb/API/SBDefines.h"
0013 
0014 namespace lldb_private {
0015 namespace python {
0016 class SWIGBridge;
0017 }
0018 } // namespace lldb_private
0019 
0020 namespace lldb {
0021 
0022 class SBTypeList;
0023 
0024 class LLDB_API SBTypeMember {
0025 public:
0026   SBTypeMember();
0027 
0028   SBTypeMember(const lldb::SBTypeMember &rhs);
0029 
0030   ~SBTypeMember();
0031 
0032   lldb::SBTypeMember &operator=(const lldb::SBTypeMember &rhs);
0033 
0034   explicit operator bool() const;
0035 
0036   bool IsValid() const;
0037 
0038   const char *GetName();
0039 
0040   lldb::SBType GetType();
0041 
0042   uint64_t GetOffsetInBytes();
0043 
0044   uint64_t GetOffsetInBits();
0045 
0046   bool IsBitfield();
0047 
0048   uint32_t GetBitfieldSizeInBits();
0049 
0050   bool GetDescription(lldb::SBStream &description,
0051                       lldb::DescriptionLevel description_level);
0052 
0053 protected:
0054   friend class SBType;
0055 
0056   void reset(lldb_private::TypeMemberImpl *);
0057 
0058   lldb_private::TypeMemberImpl &ref();
0059 
0060   const lldb_private::TypeMemberImpl &ref() const;
0061 
0062   std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_up;
0063 };
0064 
0065 class SBTypeMemberFunction {
0066 public:
0067   SBTypeMemberFunction();
0068 
0069   SBTypeMemberFunction(const lldb::SBTypeMemberFunction &rhs);
0070 
0071   ~SBTypeMemberFunction();
0072 
0073   lldb::SBTypeMemberFunction &operator=(const lldb::SBTypeMemberFunction &rhs);
0074 
0075   explicit operator bool() const;
0076 
0077   bool IsValid() const;
0078 
0079   const char *GetName();
0080 
0081   const char *GetDemangledName();
0082 
0083   const char *GetMangledName();
0084 
0085   lldb::SBType GetType();
0086 
0087   lldb::SBType GetReturnType();
0088 
0089   uint32_t GetNumberOfArguments();
0090 
0091   lldb::SBType GetArgumentTypeAtIndex(uint32_t);
0092 
0093   lldb::MemberFunctionKind GetKind();
0094 
0095   bool GetDescription(lldb::SBStream &description,
0096                       lldb::DescriptionLevel description_level);
0097 
0098 protected:
0099   friend class SBType;
0100 
0101   void reset(lldb_private::TypeMemberFunctionImpl *);
0102 
0103   lldb_private::TypeMemberFunctionImpl &ref();
0104 
0105   const lldb_private::TypeMemberFunctionImpl &ref() const;
0106 
0107   lldb::TypeMemberFunctionImplSP m_opaque_sp;
0108 };
0109 
0110 class LLDB_API SBTypeStaticField {
0111 public:
0112   SBTypeStaticField();
0113 
0114   SBTypeStaticField(const lldb::SBTypeStaticField &rhs);
0115   lldb::SBTypeStaticField &operator=(const lldb::SBTypeStaticField &rhs);
0116 
0117   ~SBTypeStaticField();
0118 
0119   explicit operator bool() const;
0120 
0121   bool IsValid() const;
0122 
0123   const char *GetName();
0124 
0125   const char *GetMangledName();
0126 
0127   lldb::SBType GetType();
0128 
0129   lldb::SBValue GetConstantValue(lldb::SBTarget target);
0130 
0131 protected:
0132   friend class SBType;
0133 
0134   explicit SBTypeStaticField(lldb_private::CompilerDecl decl);
0135 
0136   std::unique_ptr<lldb_private::CompilerDecl> m_opaque_up;
0137 };
0138 
0139 class SBType {
0140 public:
0141   SBType();
0142 
0143   SBType(const lldb::SBType &rhs);
0144 
0145   ~SBType();
0146 
0147   explicit operator bool() const;
0148 
0149   bool IsValid() const;
0150 
0151   uint64_t GetByteSize();
0152 
0153   uint64_t GetByteAlign();
0154 
0155   bool IsPointerType();
0156 
0157   bool IsReferenceType();
0158 
0159   bool IsFunctionType();
0160 
0161   bool IsPolymorphicClass();
0162 
0163   bool IsArrayType();
0164 
0165   bool IsVectorType();
0166 
0167   bool IsTypedefType();
0168 
0169   bool IsAnonymousType();
0170 
0171   bool IsScopedEnumerationType();
0172 
0173   bool IsAggregateType();
0174 
0175   lldb::SBType GetPointerType();
0176 
0177   lldb::SBType GetPointeeType();
0178 
0179   lldb::SBType GetReferenceType();
0180 
0181   lldb::SBType GetTypedefedType();
0182 
0183   lldb::SBType GetDereferencedType();
0184 
0185   lldb::SBType GetUnqualifiedType();
0186 
0187   lldb::SBType GetArrayElementType();
0188 
0189   lldb::SBType GetArrayType(uint64_t size);
0190 
0191   lldb::SBType GetVectorElementType();
0192 
0193   lldb::SBType GetCanonicalType();
0194 
0195   lldb::SBType GetEnumerationIntegerType();
0196 
0197   // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
0198   // type eBasicTypeInvalid will be returned
0199   lldb::BasicType GetBasicType();
0200 
0201   // The call below confusing and should really be renamed to "CreateBasicType"
0202   lldb::SBType GetBasicType(lldb::BasicType type);
0203 
0204   uint32_t GetNumberOfFields();
0205 
0206   uint32_t GetNumberOfDirectBaseClasses();
0207 
0208   uint32_t GetNumberOfVirtualBaseClasses();
0209 
0210   lldb::SBTypeMember GetFieldAtIndex(uint32_t idx);
0211 
0212   lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx);
0213 
0214   lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx);
0215 
0216   lldb::SBTypeStaticField GetStaticFieldWithName(const char *name);
0217 
0218   lldb::SBTypeEnumMemberList GetEnumMembers();
0219 
0220   uint32_t GetNumberOfTemplateArguments();
0221 
0222   lldb::SBType GetTemplateArgumentType(uint32_t idx);
0223 
0224   /// Return the TemplateArgumentKind of the template argument at index idx.
0225   /// Variadic argument packs are automatically expanded.
0226   lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx);
0227 
0228   lldb::SBType GetFunctionReturnType();
0229 
0230   lldb::SBTypeList GetFunctionArgumentTypes();
0231 
0232   uint32_t GetNumberOfMemberFunctions();
0233 
0234   lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx);
0235 
0236   lldb::SBModule GetModule();
0237 
0238   const char *GetName();
0239 
0240   const char *GetDisplayTypeName();
0241 
0242   lldb::TypeClass GetTypeClass();
0243 
0244   bool IsTypeComplete();
0245 
0246   uint32_t GetTypeFlags();
0247 
0248   bool GetDescription(lldb::SBStream &description,
0249                       lldb::DescriptionLevel description_level);
0250 
0251   lldb::SBType FindDirectNestedType(const char *name);
0252 
0253   lldb::SBType &operator=(const lldb::SBType &rhs);
0254 
0255   bool operator==(lldb::SBType &rhs);
0256 
0257   bool operator!=(lldb::SBType &rhs);
0258 
0259 protected:
0260   lldb_private::TypeImpl &ref();
0261 
0262   const lldb_private::TypeImpl &ref() const;
0263 
0264   lldb::TypeImplSP GetSP();
0265 
0266   void SetSP(const lldb::TypeImplSP &type_impl_sp);
0267 
0268   lldb::TypeImplSP m_opaque_sp;
0269 
0270   friend class SBFunction;
0271   friend class SBModule;
0272   friend class SBTarget;
0273   friend class SBTypeEnumMember;
0274   friend class SBTypeEnumMemberList;
0275   friend class SBTypeNameSpecifier;
0276   friend class SBTypeMember;
0277   friend class SBTypeMemberFunction;
0278   friend class SBTypeStaticField;
0279   friend class SBTypeList;
0280   friend class SBValue;
0281   friend class SBWatchpoint;
0282 
0283   friend class lldb_private::python::SWIGBridge;
0284 
0285   SBType(const lldb_private::CompilerType &);
0286   SBType(const lldb::TypeSP &);
0287   SBType(const lldb::TypeImplSP &);
0288 };
0289 
0290 class SBTypeList {
0291 public:
0292   SBTypeList();
0293 
0294   SBTypeList(const lldb::SBTypeList &rhs);
0295 
0296   ~SBTypeList();
0297 
0298   lldb::SBTypeList &operator=(const lldb::SBTypeList &rhs);
0299 
0300   explicit operator bool() const;
0301 
0302   bool IsValid();
0303 
0304   void Append(lldb::SBType type);
0305 
0306   lldb::SBType GetTypeAtIndex(uint32_t index);
0307 
0308   uint32_t GetSize();
0309 
0310 private:
0311   std::unique_ptr<lldb_private::TypeListImpl> m_opaque_up;
0312   friend class SBModule;
0313   friend class SBCompileUnit;
0314 };
0315 
0316 } // namespace lldb
0317 
0318 #endif // LLDB_API_SBTYPE_H