|
LLDB mainline
|
The base class of all Types in the Clike TypeSystem. More...
#include <Type.h>
Public Member Functions | |
| virtual | ~Type ()=default |
| Context & | GetOwningContext () const |
| The Context that owns this type. | |
| virtual Identifier | GetName () const |
| The type's qualified name. | |
| virtual const Namespace * | GetDeclContext () const |
| The namespace this type is declared in. | |
| virtual Identifier | GetUnqualifiedName () const |
| The name of this type without namespace qualifiers (e.g., string or vector<int, std::allocator<int>>). | |
| virtual std::optional< uint64_t > | GetByteSize () const |
| The size of this type in bytes, or std::nullopt if unknown (e.g., for an incomplete record or a function type). | |
| virtual std::optional< uint64_t > | GetAlignmentInBits () const |
| The alignment of this type in bits, or std::nullopt if unknown. | |
| virtual Type * | Desugar () |
| Removes all sugar (typedefs, qualifiers, elaborated types, ...). | |
| const Type * | Desugar () const |
| virtual bool | IsAggregate () const |
| True if this type has members (a struct/class/union). | |
| virtual bool | IsComplete () const |
| True if this type is not a forward declaration. | |
| virtual lldb::Encoding | GetEncoding () const |
| virtual lldb::Format | GetFormat () const |
| virtual lldb::TypeClass | GetTypeClass () const |
| virtual uint32_t | GetTypeInfo () const |
| virtual lldb::LanguageType | GetMinimumLanguage () const |
| The least specific language that can express this type. | |
| virtual Type * | StripElaborated () |
| Removes elaborated type sugar from the top of this type. | |
| const Type * | StripElaborated () const |
| virtual Type * | StripCVQualifiers () |
| Removes all cv-qualifiers from the top of this type, but no other sugar. | |
| const Type * | StripCVQualifiers () const |
| virtual unsigned | GetCVRQualifiers () const |
| The combined cv-qualifiers at the top of this type. | |
| virtual bool | IsConst () const |
| True if the outermost qualifier of this type is const. | |
| virtual std::optional< PtrAuthQualifier > | GetPtrAuthQualifier () const |
| The pointer authentication qualifier of this type, or std::nullopt if there is none. | |
| virtual Type * | GetTypedefedType () const |
| The aliased type if this is a typedef, otherwise null. | |
| virtual bool | IsVoid () const |
| True for void. | |
| virtual bool | IsChar () const |
| True for char, signed char and unsigned char. | |
| virtual bool | IsInteger () const |
| True for builtin integer types and enumerations with an integer encoding. | |
| virtual bool | IsPromotableInteger () const |
| True for types to which the C++ integral promotions apply. | |
| virtual lldb::BasicType | GetBasicTypeEnumeration () const |
| The lldb::BasicType of this type, or eBasicTypeInvalid if this is not a builtin type. | |
| virtual bool | IsPointer () const |
| True for pointers, including block pointers. | |
| virtual bool | IsBlockPointer () const |
| True for block pointers (int (^)(int)). | |
| virtual bool | IsFunctionPointer () const |
| True for function pointers (void (*)(int)). | |
| virtual bool | IsReference () const |
| True for an lvalue (T &) or rvalue (T &&) reference. | |
| virtual bool | IsRValueReference () const |
| True for an rvalue reference (T &&). | |
| virtual Type * | GetPointeeType () const |
| The pointee type of a pointer or reference, otherwise null. | |
| virtual bool | IsMemberFunctionPointer () const |
| True for a pointer to a non-static member function (R (C::*)(Args...)). | |
| virtual bool | IsMemberDataPointer () const |
| True for a pointer to a non-static data member (T C::*). | |
| virtual Type * | GetTransparentChildPointee () |
| If the children of this pointer or reference are the members of its pointee (instead of a single dereferenced child), returns the pointee. | |
| virtual Type * | GetNamedMemberPointee () |
| If members can be looked up by name through this pointer or reference (ptr->member, ref.member), returns the pointee. | |
| virtual Type * | GetDynamicTypeCandidate (DynamicTypeCheck check, llvm::function_ref< void(Type *)> complete) |
| If the dynamic type of the value of this pointer or reference may differ from its static pointee type, returns the pointee. | |
| virtual bool | IsDynamicClass (llvm::function_ref< void(Type *)> complete) |
| True if this is a C++ class with a vtable pointer. | |
| virtual Type * | GetArrayElementType () const |
| The element type of an array or vector, otherwise null. | |
| virtual std::optional< uint64_t > | GetNumElements () const |
| The number of elements of an array, or std::nullopt if this is not an array or the bound is unknown. | |
| virtual bool | IsVector () const |
| True for GCC/Clang vector types. | |
| virtual uint64_t | GetDIEUID () const |
| The UID of the DIE that describes this type, or LLDB_INVALID_UID. | |
| virtual bool | IsFunction () const |
| True for a function type. | |
| virtual Type * | GetReturnType () const |
| The return type of a function, otherwise null. | |
| virtual uint32_t | GetNumParameters () const |
| The parameters of a function, excluding the implicit this parameter. | |
| virtual Type * | GetParameterAtIndex (uint32_t idx) const |
| virtual Type * | GetEnumerationIntegerType () const |
| The underlying integer type of an enumeration, otherwise null. | |
| virtual bool | IsScopedEnumeration () const |
| True for scoped enumerations (enum class). | |
| virtual llvm::ArrayRef< Enumerator > | GetEnumerators () const |
| virtual bool | IsRecord () const |
| True for C structs/unions, C++ classes and Objective-C interfaces. | |
| virtual bool | IsObjCInterface () const |
| True for Objective-C interfaces. | |
| virtual bool | IsUnion () const |
| virtual bool | IsClassKeyword () const |
| True if this record was declared with the class keyword. | |
| virtual bool | IsAnonymousStructOrUnion () const |
| True for anonymous structs and unions (struct { int y; };). | |
| virtual uint32_t | GetNumFields () const |
| virtual const Field * | GetFieldAtIndex (uint32_t idx) const |
| virtual uint32_t | GetNumBaseClasses () const |
| The direct base classes of a C++ class. | |
| virtual const BaseClass * | GetBaseClassAtIndex (uint32_t idx) const |
| virtual bool | IsPolymorphic () const |
| True if this is a C++ class that has a vtable. | |
| virtual bool | IsTemplateInstantiation () const |
| True for class template specializations. | |
| virtual uint32_t | GetNumTemplateArguments () const |
| virtual const TemplateArgument * | GetTemplateArgumentAtIndex (uint32_t idx) const |
| virtual bool | AreMemberFunctionsParsed () const |
| True if the member functions (or Objective-C methods) of this record have been parsed. | |
| virtual uint32_t | GetNumMemberFunctions () const |
| virtual const MemberFunction * | GetMemberFunctionAtIndex (uint32_t idx) const |
| virtual uint32_t | GetNumObjCMethods () const |
| The methods of an Objective-C interface. | |
| virtual const ObjCMethod * | GetObjCMethodAtIndex (uint32_t idx) const |
| virtual uint32_t | GetNumStaticDataMembers () const |
| virtual const StaticDataMember * | GetStaticDataMemberAtIndex (uint32_t idx) const |
| virtual Type * | GetNestedTypeWithName (llvm::StringRef name) const |
| Returns the type with the given unqualified name that is declared directly inside this record, or null if there is no such type. | |
| virtual uint32_t | GetNumNestedTypes () const |
| The number of types declared directly inside this record. | |
| virtual Type * | GetHomogeneousAggregateBase (uint32_t &num_fields) const |
If this record is a homogeneous floating-point or vector aggregate, returns the type of its fields and sets num_fields to the number of fields. | |
| bool | HasFields (llvm::function_ref< void(Type *)> complete) |
| True if this type is a record that has fields, either directly or in one of its base classes. | |
Static Public Attributes | |
| static char | ID = 0 |
| LLVM-style RTTI support. | |
Private Member Functions | |
| void | SetOwningContext (Context &context) |
Private Attributes | |
| Context * | m_context = nullptr |
Friends | |
| class | Context |
The base class of all Types in the Clike TypeSystem.
This implements the backend that the TypeSystem API implementation of TypeSystemClike calls. This class is also used by TypeSystemClike as its opaque_compiler_type_t type.
Types are usually immutable once created.
Definition at line 230 of file source/Plugins/TypeSystem/Clike/Type.h.
|
virtualdefault |
|
inlinevirtual |
True if the member functions (or Objective-C methods) of this record have been parsed.
These are parsed lazily, so a complete record might not have its member functions parsed yet.
Definition at line 464 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Removes all sugar (typedefs, qualifiers, elaborated types, ...).
Definition at line 264 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by HasFields().
|
inline |
Definition at line 265 of file source/Plugins/TypeSystem/Clike/Type.h.
References Desugar().
Referenced by Desugar().
|
inlinevirtual |
The alignment of this type in bits, or std::nullopt if unknown.
Definition at line 259 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The element type of an array or vector, otherwise null.
Definition at line 393 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 444 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by HasFields().
|
inlinevirtual |
The lldb::BasicType of this type, or eBasicTypeInvalid if this is not a builtin type.
Definition at line 329 of file source/Plugins/TypeSystem/Clike/Type.h.
References lldb::eBasicTypeInvalid.
|
inlinevirtual |
The size of this type in bytes, or std::nullopt if unknown (e.g., for an incomplete record or a function type).
Definition at line 256 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The combined cv-qualifiers at the top of this type.
This reuses the, using the clang::Qualifiers values of Const = 0x1, Restrict = 0x2, Volatile = 0x4.
Definition at line 300 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The namespace this type is declared in.
Null for the global namespace and for types without a declaration (e.g., pointers).
Definition at line 248 of file source/Plugins/TypeSystem/Clike/Type.h.
References lldb_private::Namespace.
|
inlinevirtual |
The UID of the DIE that describes this type, or LLDB_INVALID_UID.
Only arrays store this so that variable-length bounds can be resolved.
Definition at line 406 of file source/Plugins/TypeSystem/Clike/Type.h.
References UINT64_MAX.
|
inlinevirtual |
If the dynamic type of the value of this pointer or reference may differ from its static pointee type, returns the pointee.
Otherwise returns null.
This is the case for pointers to Objective-C objects (if check contains DynamicTypeCheck::ObjC), pointers or references to dynamic C++ classes (if check contains DynamicTypeCheck::CPlusPlus) and void *.
complete is called to request completion of a record whose dynamic-ness is only known after completion.
Definition at line 381 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 273 of file source/Plugins/TypeSystem/Clike/Type.h.
References lldb::eEncodingInvalid.
|
inlinevirtual |
The underlying integer type of an enumeration, otherwise null.
Definition at line 419 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 423 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 440 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 274 of file source/Plugins/TypeSystem/Clike/Type.h.
References lldb::eFormatDefault.
|
inlinevirtual |
If this record is a homogeneous floating-point or vector aggregate, returns the type of its fields and sets num_fields to the number of fields.
Otherwise returns null and sets num_fields to 0. Expects a complete record.
Definition at line 496 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 467 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The least specific language that can express this type.
Definition at line 279 of file source/Plugins/TypeSystem/Clike/Type.h.
References lldb::eLanguageTypeC.
|
inlinevirtual |
The type's qualified name.
Definition at line 244 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
If members can be looked up by name through this pointer or reference (ptr->member, ref.member), returns the pointee.
Otherwise returns null.
Definition at line 369 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Returns the type with the given unqualified name that is declared directly inside this record, or null if there is no such type.
Definition at line 485 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The direct base classes of a C++ class.
Definition at line 443 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by HasFields().
|
inlinevirtual |
The number of elements of an array, or std::nullopt if this is not an array or the bound is unknown.
Definition at line 397 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 439 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by HasFields().
|
inlinevirtual |
Definition at line 466 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The number of types declared directly inside this record.
Definition at line 490 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The methods of an Objective-C interface.
Definition at line 472 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The parameters of a function, excluding the implicit this parameter.
Definition at line 415 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 477 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 453 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 473 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inline |
The Context that owns this type.
Definition at line 238 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 416 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The pointee type of a pointer or reference, otherwise null.
Member pointers have no pointee type.
Definition at line 350 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The pointer authentication qualifier of this type, or std::nullopt if there is none.
Definition at line 307 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The return type of a function, otherwise null.
Definition at line 412 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 479 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 455 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
If the children of this pointer or reference are the members of its pointee (instead of a single dereferenced child), returns the pointee.
Otherwise returns null.
This is primarily used for preserving existing behaviour for Objective-C interfaces.
Definition at line 364 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 275 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The aliased type if this is a typedef, otherwise null.
Definition at line 312 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 276 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
The name of this type without namespace qualifiers (e.g., string or vector<int, std::allocator<int>>).
Definition at line 252 of file source/Plugins/TypeSystem/Clike/Type.h.
True if this type is a record that has fields, either directly or in one of its base classes.
Incomplete records are treated as having fields. complete is called on each record before it is inspected.
Definition at line 16 of file Plugins/TypeSystem/Clike/Type.cpp.
References Desugar(), lldb_private::clike::TypeRef::Get(), GetBaseClassAtIndex(), GetNumBaseClasses(), GetNumFields(), lldb_private::clike::BaseClass::GetType(), HasFields(), and IsComplete().
Referenced by HasFields().
|
inlinevirtual |
True if this type has members (a struct/class/union).
Definition at line 268 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for anonymous structs and unions (struct { int y; };).
Definition at line 437 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for block pointers (int (^)(int)).
Definition at line 337 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for char, signed char and unsigned char.
Definition at line 318 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True if this record was declared with the class keyword.
Definition at line 434 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True if this type is not a forward declaration.
Definition at line 271 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by HasFields().
|
inlinevirtual |
True if the outermost qualifier of this type is const.
Definition at line 303 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True if this is a C++ class with a vtable pointer.
complete is called first to requestion completion of the class.
Definition at line 388 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for a function type.
Definition at line 409 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for function pointers (void (*)(int)).
Definition at line 340 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for builtin integer types and enumerations with an integer encoding.
Pointers and std::nullptr_t are not integers.
Definition at line 322 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for a pointer to a non-static data member (T C::*).
Definition at line 356 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for a pointer to a non-static member function (R (C::*)(Args...)).
Definition at line 353 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for Objective-C interfaces.
Definition at line 429 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for pointers, including block pointers.
Definition at line 334 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True if this is a C++ class that has a vtable.
Definition at line 449 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for types to which the C++ integral promotions apply.
Definition at line 325 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for C structs/unions, C++ classes and Objective-C interfaces.
Definition at line 426 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for an lvalue (T &) or rvalue (T &&) reference.
Definition at line 343 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for an rvalue reference (T &&).
Definition at line 346 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for scoped enumerations (enum class).
Definition at line 422 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for class template specializations.
Definition at line 452 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Definition at line 431 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for GCC/Clang vector types.
Definition at line 402 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
True for void.
Definition at line 315 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlineprivate |
Definition at line 511 of file source/Plugins/TypeSystem/Clike/Type.h.
|
inlinevirtual |
Removes all cv-qualifiers from the top of this type, but no other sugar.
Definition at line 291 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by StripCVQualifiers().
|
inline |
Definition at line 292 of file source/Plugins/TypeSystem/Clike/Type.h.
References StripCVQualifiers().
|
inlinevirtual |
Removes elaborated type sugar from the top of this type.
Unlike Desugar() this preserves typedefs.
Definition at line 285 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by StripElaborated().
|
inline |
Definition at line 286 of file source/Plugins/TypeSystem/Clike/Type.h.
References StripElaborated().
|
friend |
Definition at line 510 of file source/Plugins/TypeSystem/Clike/Type.h.
References Context.
Referenced by Context, GetOwningContext(), and SetOwningContext().
|
static |
LLVM-style RTTI support.
Definition at line 233 of file source/Plugins/TypeSystem/Clike/Type.h.
|
private |
Definition at line 513 of file source/Plugins/TypeSystem/Clike/Type.h.
Referenced by GetOwningContext(), and SetOwningContext().