35 return type_system_sp->IsAggregateType(
m_type);
42 return type_system_sp->IsAnonymousType(
m_type);
49 return type_system_sp->IsScopedEnumerationType(
m_type);
54 bool *is_incomplete)
const {
57 return type_system_sp->IsArrayType(
m_type, element_type_ptr, size,
61 element_type_ptr->
Clear();
65 *is_incomplete =
false;
70 uint64_t *size)
const {
73 return type_system_sp->IsVectorType(
m_type, element_type, size);
80 return type_system_sp->IsRuntimeGeneratedType(
m_type);
87 return type_system_sp->IsCharType(
m_type);
94 return type_system_sp->IsCompleteType(
m_type);
101 return type_system_sp->IsForcefullyCompleted(
m_type);
108 return type_system_sp->IsConst(
m_type);
115 return type_system_sp->IsCStringType(
m_type, length);
122 return type_system_sp->IsFunctionType(
m_type);
131 return type_system_sp->IsHomogeneousAggregate(
m_type, base_type_ptr);
138 return type_system_sp->GetNumberOfFunctionArguments(
m_type);
153 return type_system_sp->IsFunctionPointerType(
m_type);
160 return type_system_sp->IsMemberFunctionPointerType(
m_type);
168 return type_system_sp->IsBlockPointerType(
m_type, function_pointer_type_ptr);
175 return type_system_sp->IsIntegerType(
m_type, is_signed);
182 return type_system_sp->IsEnumerationType(
m_type, is_signed);
193 return type_system_sp->IsPointerType(
m_type, pointee_type);
196 pointee_type->
Clear();
203 return type_system_sp->IsPointerOrReferenceType(
m_type, pointee_type);
206 pointee_type->
Clear();
211 bool *is_rvalue)
const {
214 return type_system_sp->IsReferenceType(
m_type, pointee_type, is_rvalue);
217 pointee_type->
Clear();
224 return type_system_sp->ShouldTreatScalarValueAsAddress(
m_type);
229 bool &is_complex)
const {
232 return type_system_sp->IsFloatingPointType(
m_type, count, is_complex);
242 return type_system_sp->IsDefined(
m_type);
249 return type_system_sp->IsPolymorphicClass(
m_type);
255 bool check_cplusplus,
256 bool check_objc)
const {
259 return type_system_sp->IsPossibleDynamicType(
m_type, dynamic_pointee_type,
260 check_cplusplus, check_objc);
267 return type_system_sp->IsScalarType(
m_type);
274 return type_system_sp->IsTemplateType(
m_type);
281 return type_system_sp->IsTypedefType(
m_type);
288 return type_system_sp->IsVoidType(
m_type);
309 return type_system_sp->IsBeingDefined(
m_type);
318 return type_system_sp->GetCompleteType(
m_type);
325 return type_system_sp->GetPointerByteSize();
332 return type_system_sp->GetTypeName(
m_type, BaseOnly);
340 return type_system_sp->GetDisplayTypeName(
m_type);
348 return type_system_sp->GetTypeInfo(
m_type,
349 pointee_or_element_compiler_type);
356 return type_system_sp->GetMinimumLanguage(
m_type);
363 return type_system_sp->GetTypeClass(
m_type);
364 return lldb::eTypeClassInvalid;
382 return type_system_sp->GetTypeQualifiers(
m_type);
429 return type_system_sp->GetFunctionArgumentCount(
m_type);
453 return type_system_sp->GetNumMemberFunctions(
m_type);
461 return type_system_sp->GetMemberFunctionAtIndex(
m_type, idx);
558std::optional<uint64_t>
562 return type_system_sp->GetBitSize(
m_type, exe_scope);
566std::optional<uint64_t>
568 if (std::optional<uint64_t> bit_size =
GetBitSize(exe_scope))
569 return (*bit_size + 7) / 8;
577 return type_system_sp->GetTypeBitAlign(
m_type, exe_scope);
584 return type_system_sp->GetEncoding(
m_type, count);
591 return type_system_sp->GetFormat(
m_type);
599 return type_system_sp->GetNumChildren(
m_type, omit_empty_base_classes,
607 return type_system_sp->GetBasicTypeEnumeration(
m_type);
614 const llvm::APSInt &value)>
const &callback)
const {
617 return type_system_sp->ForEachEnumerator(
m_type, callback);
623 return type_system_sp->GetNumFields(
m_type);
628 uint64_t *bit_offset_ptr,
630 bool *is_bitfield_ptr)
const {
634 bitfield_bit_size_ptr, is_bitfield_ptr);
641 return type_system_sp->GetNumDirectBaseClasses(
m_type);
648 return type_system_sp->GetNumVirtualBaseClasses(
m_type);
673 const char *name,
CompilerType *field_compiler_type_ptr,
674 uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
675 bool *is_bitfield_ptr)
const {
677 std::string field_name;
678 for (
unsigned index = 0; index < count; index++) {
681 bitfield_bit_size_ptr, is_bitfield_ptr));
682 if (strcmp(field_name.c_str(), name) == 0) {
683 if (field_compiler_type_ptr)
684 *field_compiler_type_ptr = field_compiler_type;
693 bool omit_empty_base_classes,
bool ignore_array_bounds,
694 std::string &child_name,
uint32_t &child_byte_size,
695 int32_t &child_byte_offset,
uint32_t &child_bitfield_bit_size,
696 uint32_t &child_bitfield_bit_offset,
bool &child_is_base_class,
697 bool &child_is_deref_of_parent,
ValueObject *valobj,
698 uint64_t &language_flags)
const {
702 m_type, exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
703 ignore_array_bounds, child_name, child_byte_size, child_byte_offset,
704 child_bitfield_bit_size, child_bitfield_bit_offset,
705 child_is_base_class, child_is_deref_of_parent, valobj,
744 llvm::StringRef name,
bool omit_empty_base_classes,
745 std::vector<uint32_t> &child_indexes)
const {
746 if (
IsValid() && !name.empty()) {
748 return type_system_sp->GetIndexOfChildMemberWithName(
749 m_type, name, omit_empty_base_classes, child_indexes);
757 return type_system_sp->GetNumTemplateArguments(
m_type, expand_pack);
766 return type_system_sp->GetTemplateArgumentKind(
m_type, idx, expand_pack);
771 bool expand_pack)
const {
779std::optional<CompilerType::IntegralTemplateArgument>
783 return type_system_sp->GetIntegralTemplateArgument(
m_type, idx, expand_pack);
797 return type_system_sp->ShouldPrintAsOneLiner(
m_type, valobj);
804 return type_system_sp->IsMeaninglessWithoutDynamicResolution(
m_type);
814 bool omit_empty_base_classes)
const {
815 if (
IsValid() && !name.empty()) {
817 return type_system_sp->GetIndexOfChildWithName(
m_type, name,
818 omit_empty_base_classes);
828 size_t data_byte_size,
uint32_t bitfield_bit_size,
829 uint32_t bitfield_bit_offset,
bool show_types,
830 bool show_summary,
bool verbose,
uint32_t depth) {
833 type_system_sp->DumpValue(
m_type, exe_ctx, s, format, data,
834 data_byte_offset, data_byte_size,
835 bitfield_bit_size, bitfield_bit_offset,
836 show_types, show_summary, verbose, depth);
847 return type_system_sp->DumpTypeValue(
m_type, s, format, data, byte_offset,
848 byte_size, bitfield_bit_size,
849 bitfield_bit_offset, exe_scope);
856 size_t data_byte_size) {
859 type_system_sp->DumpSummary(
m_type, exe_ctx, s, data, data_byte_offset,
866 type_system_sp->DumpTypeDescription(
m_type, level);
873 type_system_sp->DumpTypeDescription(
m_type, s, level);
880 return type_system_sp->dump(
m_type);
881 llvm::errs() <<
"<invalid>\n";
887 size_t data_byte_size,
Scalar &value,
901 std::optional<uint64_t> byte_size =
GetByteSize(exe_scope);
911 if (*byte_size <=
sizeof(
unsigned long long)) {
912 uint64_t uval64 = data.
GetMaxU64(&offset, *byte_size);
913 if (*byte_size <=
sizeof(
unsigned int)) {
914 value = (
unsigned int)uval64;
916 }
else if (*byte_size <=
sizeof(
unsigned long)) {
917 value = (
unsigned long)uval64;
919 }
else if (*byte_size <=
sizeof(
unsigned long long)) {
920 value = (
unsigned long long)uval64;
928 if (*byte_size <=
sizeof(
long long)) {
929 int64_t sval64 = data.
GetMaxS64(&offset, *byte_size);
930 if (*byte_size <=
sizeof(
int)) {
933 }
else if (*byte_size <=
sizeof(
long)) {
934 value = (long)sval64;
936 }
else if (*byte_size <=
sizeof(
long long)) {
937 value = (
long long)sval64;
945 if (*byte_size <=
sizeof(
long double)) {
948 if (*byte_size ==
sizeof(
float)) {
949 if (
sizeof(
float) ==
sizeof(
uint32_t)) {
950 u32 = data.
GetU32(&offset);
951 value = *((
float *)&u32);
953 }
else if (
sizeof(
float) ==
sizeof(uint64_t)) {
954 u64 = data.
GetU64(&offset);
955 value = *((
float *)&u64);
958 }
else if (*byte_size ==
sizeof(
double)) {
959 if (
sizeof(
double) ==
sizeof(
uint32_t)) {
960 u32 = data.
GetU32(&offset);
961 value = *((
double *)&u32);
963 }
else if (
sizeof(
double) ==
sizeof(uint64_t)) {
964 u64 = data.
GetU64(&offset);
965 value = *((
double *)&u64);
968 }
else if (*byte_size ==
sizeof(
long double)) {
969 if (
sizeof(
long double) ==
sizeof(
uint32_t)) {
970 u32 = data.
GetU32(&offset);
971 value = *((
long double *)&u32);
973 }
else if (
sizeof(
long double) ==
sizeof(uint64_t)) {
974 u64 = data.
GetU64(&offset);
975 value = *((
long double *)&u64);
991 return type_system_sp->Verify(
m_type);
1010 assert(m_typesystem_sp);
1011 return m_typesystem_sp.get();
1022 return !(lhs == rhs);
Represents a generic declaration context in a program.
This is a minimal wrapper of a TypeSystem shared pointer as returned by CompilerType which conventien...
lldb::TypeSystemSP GetSharedPointer() const
bool operator==(const TypeSystemSPWrapper &other) const
lldb::TypeSystemSP m_typesystem_sp
TypeSystem * operator->() const
Only to be used in a one-off situations like if (typesystem && typesystem->method()) Do not store thi...
Generic representation of a type in a programming language.
CompilerType GetTypeForFormatters() const
CompilerType GetTypeTemplateArgument(size_t idx, bool expand_pack=false) const
lldb::LanguageType GetMinimumLanguage()
bool GetValueAsScalar(const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, Scalar &value, ExecutionContextScope *exe_scope) const
bool Verify() const
If the type is valid, ask the TypeSystem to verify the integrity of the type to catch CompilerTypes t...
bool IsEnumerationType(bool &is_signed) const
lldb::BasicType GetBasicTypeEnumeration() const
std::optional< IntegralTemplateArgument > GetIntegralTemplateArgument(size_t idx, bool expand_pack=false) const
Returns the value of the template argument and its type.
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
CompilerType GetArrayType(uint64_t size) const
CompilerType GetChildCompilerTypeAtIndex(ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset, bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj, uint64_t &language_flags) const
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const
Create related types using the current type's AST.
bool IsCStringType(uint32_t &length) const
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
void SetCompilerType(lldb::TypeSystemWP type_system, lldb::opaque_compiler_type_t type)
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
CompilerType AddConstModifier() const
Return a new CompilerType adds a const modifier to this type if this type is valid and the type syste...
lldb::Encoding GetEncoding(uint64_t &count) const
bool IsArrayType(CompilerType *element_type=nullptr, uint64_t *size=nullptr, bool *is_incomplete=nullptr) const
ConstString GetDisplayTypeName() const
CompilerType GetVirtualBaseClassAtIndex(size_t idx, uint32_t *bit_offset_ptr) const
size_t GetNumMemberFunctions() const
CompilerType GetFunctionArgumentTypeAtIndex(size_t idx) const
uint32_t IsHomogeneousAggregate(CompilerType *base_type_ptr) const
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
bool IsCompleteType() const
CompilerType GetRValueReferenceType() const
Return a new CompilerType that is a R value reference to this type if this type is valid and the type...
size_t GetIndexOfChildMemberWithName(llvm::StringRef name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes) const
Lookup a child member given a name.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
lldb::TypeClass GetTypeClass() const
lldb::opaque_compiler_type_t GetOpaqueQualType() const
size_t GetNumTemplateArguments(bool expand_pack=false) const
Return the number of template arguments the type has.
CompilerType AddVolatileModifier() const
Return a new CompilerType adds a volatile modifier to this type if this type is valid and the type sy...
CompilerType AddRestrictModifier() const
Return a new CompilerType adds a restrict modifier to this type if this type is valid and the type sy...
bool IsBeingDefined() const
lldb::TypeSystemWP m_type_system
uint32_t GetNumVirtualBaseClasses() const
size_t GetPointerByteSize() const
AST related queries.
void DumpSummary(ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size)
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
void DumpValue(ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth)
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
If this type is an enumeration, iterate through all of its enumerators using a callback.
bool IsFloatingPointType(uint32_t &count, bool &is_complex) const
LLVM_DUMP_METHOD void dump() const
Dumping types.
CompilerType GetLValueReferenceType() const
Return a new CompilerType that is a L value reference to this type if this type is valid and the type...
uint32_t GetNumFields() const
size_t GetNumberOfFunctionArguments() const
bool IsIntegerOrEnumerationType(bool &is_signed) const
bool IsScopedEnumerationType() const
bool ShouldTreatScalarValueAsAddress() const
CompilerType GetNonReferenceType() const
If this type is a reference to a type (L value or R value reference), return a new type with the refe...
uint32_t GetNumDirectBaseClasses() const
bool IsMeaninglessWithoutDynamicResolution() const
uint32_t GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr=nullptr) const
bool IsAnonymousType() const
ConstString GetTypeName(bool BaseOnly=false) const
uint32_t GetIndexOfChildWithName(llvm::StringRef name, bool omit_empty_base_classes) const
Lookup a child given a name.
CompilerType GetTypedefedType() const
If the current object represents a typedef type, get the underlying type.
bool IsReferenceType(CompilerType *pointee_type=nullptr, bool *is_rvalue=nullptr) const
bool DumpTypeValue(Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope)
bool IsArrayOfScalarType() const
bool IsAggregateType() const
CompilerType GetArrayElementType(ExecutionContextScope *exe_scope) const
Creating related types.
lldb::Format GetFormat() const
CompilerType GetFullyUnqualifiedType() const
unsigned GetTypeQualifiers() const
CompilerType GetDirectBaseClassAtIndex(size_t idx, uint32_t *bit_offset_ptr) const
std::optional< size_t > GetTypeBitAlign(ExecutionContextScope *exe_scope) const
bool IsFunctionPointerType() const
CompilerType GetPointeeType() const
If this type is a pointer type, return the type that the pointer points to, else return an invalid ty...
bool IsIntegerType(bool &is_signed) const
bool GetCompleteType() const
Type Completion.
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
int GetFunctionArgumentCount() const
Returns -1 if this isn't a function of if the function doesn't have a prototype Returns a value >= 0 ...
std::optional< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
uint32_t GetIndexOfFieldWithName(const char *name, CompilerType *field_compiler_type=nullptr, uint64_t *bit_offset_ptr=nullptr, uint32_t *bitfield_bit_size_ptr=nullptr, bool *is_bitfield_ptr=nullptr) const
bool IsFunctionType() const
CompilerType GetEnumerationIntegerType() const
lldb::opaque_compiler_type_t m_type
bool IsScalarType() const
bool IsForcefullyCompleted() const
bool IsPolymorphicClass() const
CompilerType CreateTypedef(const char *name, const CompilerDeclContext &decl_ctx, uint32_t payload) const
Create a typedef to this type using "name" as the name of the typedef this type is valid and the type...
bool IsTypedefType() const
CompilerType GetFunctionReturnType() const
bool IsVectorType(CompilerType *element_type=nullptr, uint64_t *size=nullptr) const
bool IsMemberFunctionPointerType() const
CompilerType GetAtomicType() const
Return a new CompilerType that is the atomic type of this type.
bool IsTemplateType() const
CompilerType GetCanonicalType() const
void DumpTypeDescription(lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) const
Dump to stdout.
bool IsRuntimeGeneratedType() const
lldb::TemplateArgumentKind GetTemplateArgumentKind(size_t idx, bool expand_pack=false) const
LazyBool ShouldPrintAsOneLiner(ValueObject *valobj) const
TypeMemberFunctionImpl GetMemberFunctionAtIndex(size_t idx)
bool IsPointerOrReferenceType(CompilerType *pointee_type=nullptr) const
bool IsPointerToScalarType() const
bool IsPointerType(CompilerType *pointee_type=nullptr) const
A uniqued constant string class.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A stream class that can stream formatted output to a file.
Interface for representing a type system.
A class that represents a running process on the host machine.
bool operator!=(const Address &lhs, const Address &rhs)
bool operator==(const Address &lhs, const Address &rhs)
void * opaque_compiler_type_t
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Format
Display format definitions.
LanguageType
Programming language type.
@ eLanguageTypeC
Non-standardized C, such as K&R.
@ eTemplateArgumentKindNull
Encoding
Register encoding definitions.
@ eEncodingVector
vector registers
@ eEncodingUint
unsigned integer
@ eEncodingSint
signed integer