LLDB mainline
CompilerType.h
Go to the documentation of this file.
1//===-- CompilerType.h ------------------------------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SYMBOL_COMPILERTYPE_H
10#define LLDB_SYMBOL_COMPILERTYPE_H
11
12#include <functional>
13#include <optional>
14#include <string>
15#include <vector>
16
17#include "lldb/Utility/Scalar.h"
18#include "lldb/lldb-private.h"
19#include "llvm/ADT/APSInt.h"
20#include "llvm/Support/Casting.h"
21
22namespace lldb_private {
23
24class DataExtractor;
25class TypeSystem;
26
27/// Generic representation of a type in a programming language.
28///
29/// This class serves as an abstraction for a type inside one of the TypeSystems
30/// implemented by the language plugins. It does not have any actual logic in it
31/// but only stores an opaque pointer and a pointer to the TypeSystem that
32/// gives meaning to this opaque pointer. All methods of this class should call
33/// their respective method in the TypeSystem interface and pass the opaque
34/// pointer along.
35///
36/// \see lldb_private::TypeSystem
38public:
39 /// Creates a CompilerType with the given TypeSystem and opaque compiler type.
40 ///
41 /// This constructor should only be called from the respective TypeSystem
42 /// implementation.
43 ///
44 /// \see lldb_private::TypeSystemClang::GetType(clang::QualType)
47
48 /// This is a minimal wrapper of a TypeSystem shared pointer as
49 /// returned by CompilerType which conventien dyn_cast support.
52
53 public:
56 : m_typesystem_sp(typesystem_sp) {}
57
58 template <class TypeSystemType> bool isa_and_nonnull() {
59 if (auto *ts = m_typesystem_sp.get())
60 return llvm::isa<TypeSystemType>(ts);
61 return false;
62 }
63
64 /// Return a shared_ptr<TypeSystemType> if dyn_cast succeeds.
65 template <class TypeSystemType>
66 std::shared_ptr<TypeSystemType> dyn_cast_or_null() {
68 return std::shared_ptr<TypeSystemType>(
69 m_typesystem_sp, llvm::cast<TypeSystemType>(m_typesystem_sp.get()));
70 return nullptr;
71 }
72
73 explicit operator bool() const {
74 return static_cast<bool>(m_typesystem_sp);
75 }
76 bool operator==(const TypeSystemSPWrapper &other) const;
77 bool operator!=(const TypeSystemSPWrapper &other) const {
78 return !(*this == other);
79 }
80
81 /// Only to be used in a one-off situations like
82 /// if (typesystem && typesystem->method())
83 /// Do not store this pointer!
84 TypeSystem *operator->() const;
85
87 };
88
89 CompilerType(TypeSystemSPWrapper type_system,
91
94
95 CompilerType() = default;
96
97 /// Operators.
98 /// \{
99 const CompilerType &operator=(const CompilerType &rhs) {
101 m_type = rhs.m_type;
102 return *this;
103 }
104
105 bool operator<(const CompilerType &rhs) const {
106 auto lts = m_type_system.lock();
107 auto rts = rhs.m_type_system.lock();
108 if (lts.get() == rts.get())
109 return m_type < rhs.m_type;
110 return lts.get() < rts.get();
111 }
112 /// \}
113
114 /// Tests.
115 /// \{
116 explicit operator bool() const {
117 return m_type_system.lock() && m_type;
118 }
119
120 bool IsValid() const { return (bool)*this; }
121
122 bool IsArrayType(CompilerType *element_type = nullptr,
123 uint64_t *size = nullptr,
124 bool *is_incomplete = nullptr) const;
125
126 bool IsVectorType(CompilerType *element_type = nullptr,
127 uint64_t *size = nullptr) const;
128
129 bool IsArrayOfScalarType() const;
130
131 bool IsAggregateType() const;
132
133 bool IsAnonymousType() const;
134
135 bool IsScopedEnumerationType() const;
136
137 bool IsBeingDefined() const;
138
139 bool IsCharType() const;
140
141 bool IsCompleteType() const;
142
143 bool IsConst() const;
144
145 bool IsDefined() const;
146
147 bool IsComplexType() const;
148
149 /// Returns \c true for floating point types (including complex floats).
150 bool IsFloatingPointType() const;
151
152 /// Returns \c true for non-complex float types.
153 bool IsRealFloatingPointType() const;
154
155 bool IsFunctionType() const;
156
157 uint32_t IsHomogeneousAggregate(CompilerType *base_type_ptr) const;
158
159 size_t GetNumberOfFunctionArguments() const;
160
161 CompilerType GetFunctionArgumentAtIndex(const size_t index) const;
162
164
165 bool IsFunctionPointerType() const;
166
167 bool IsMemberFunctionPointerType() const;
168
169 bool IsMemberDataPointerType() const;
170
171 bool
172 IsBlockPointerType(CompilerType *function_pointer_type_ptr = nullptr) const;
173
174 bool IsIntegerType(bool &is_signed) const;
175
176 bool IsEnumerationType(bool &is_signed) const;
177
178 bool IsIntegerOrEnumerationType(bool &is_signed) const;
179
180 bool IsPolymorphicClass() const;
181
182 /// \param target_type Can pass nullptr.
183 bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus,
184 bool check_objc) const;
185
186 bool IsPointerToScalarType() const;
187
188 bool IsRuntimeGeneratedType() const;
189
190 bool IsPointerType(CompilerType *pointee_type = nullptr) const;
191
192 bool IsPointerOrReferenceType(CompilerType *pointee_type = nullptr) const;
193
194 bool IsReferenceType(CompilerType *pointee_type = nullptr,
195 bool *is_rvalue = nullptr) const;
196
198
199 bool IsScalarType() const;
200
201 bool IsTemplateType() const;
202
203 bool IsTypedefType() const;
204
205 bool IsVoidType() const;
206
207 bool HasPointerAuthQualifier() const;
208
209 /// This is used when you don't care about the signedness of the integer.
210 bool IsInteger() const;
211
212 /// This is used when you don't care about the signedness of the enum.
213 bool IsEnumerationType() const;
214
215 bool IsUnscopedEnumerationType() const;
216
218
219 bool IsSigned() const;
220
221 bool IsNullPtrType() const;
222
223 bool IsBoolean() const;
224
226
228
229 /// Checks if the type is eligible for integral promotion.
230 /// \see GetPromotedIntegerType
231 bool IsPromotableIntegerType() const;
232
233 bool IsPointerToVoid() const;
234
235 bool IsRecordType() const;
236
237 //// Checks whether `target_base` is a virtual base of `type` (direct or
238 /// indirect). If it is, stores the first virtual base type on the path from
239 /// `type` to `target_type`. Parameter "virtual_base" is where the first
240 /// virtual base type gets stored. Parameter "carry_virtual" is used to
241 /// denote that we're in a recursive check of virtual base classes and we
242 /// have already seen a virtual base class (so should only check direct
243 /// base classes).
244 /// Note: This may only be defined in TypeSystemClang.
245 bool IsVirtualBase(CompilerType target_base, CompilerType *virtual_base,
246 bool carry_virtual = false) const;
247
248 /// This may only be defined in TypeSystemClang.
250
251 bool IsBasicType() const;
252
253 std::string TypeDescription();
254
255 bool CompareTypes(CompilerType rhs) const;
256
257 const char *GetTypeTag();
258
259 /// Go through the base classes and count non-empty ones.
261
262 /// \}
263
264 /// Type Completion.
265 /// \{
266 bool GetCompleteType() const;
267 /// \}
268
269 bool IsForcefullyCompleted() const;
270
271 /// AST related queries.
272 /// \{
273 size_t GetPointerByteSize() const;
274 /// \}
275
276 unsigned GetPtrAuthKey() const;
277
278 unsigned GetPtrAuthDiscriminator() const;
279
280 bool GetPtrAuthAddressDiversity() const;
281
282 /// Accessors.
283 /// \{
284
285 /// Returns a shared pointer to the type system. The
286 /// TypeSystem::TypeSystemSPWrapper can be compared for equality.
288
289 template <typename TypeSystemType>
290 std::shared_ptr<TypeSystemType> GetTypeSystem() const {
291 return GetTypeSystem().dyn_cast_or_null<TypeSystemType>();
292 }
293
294 ConstString GetTypeName(bool BaseOnly = false) const;
295
297
299
300 uint32_t
301 GetTypeInfo(CompilerType *pointee_or_element_compiler_type = nullptr) const;
302
304
306
307 lldb::TypeClass GetTypeClass() const;
308
309 void SetCompilerType(lldb::TypeSystemWP type_system,
311 void SetCompilerType(TypeSystemSPWrapper type_system,
313
314 unsigned GetTypeQualifiers() const;
315 /// \}
316
317 /// Creating related types.
318 /// \{
320
321 CompilerType GetArrayType(uint64_t size) const;
322
324
326
328
329 /// Returns -1 if this isn't a function of if the function doesn't
330 /// have a prototype Returns a value >= 0 if there is a prototype.
331 int GetFunctionArgumentCount() const;
332
334
336
337 size_t GetNumMemberFunctions() const;
338
340
341 /// If this type is a reference to a type (L value or R value reference),
342 /// return a new type with the reference removed, else return the current type
343 /// itself.
345
346 /// If this type is a pointer type, return the type that the pointer points
347 /// to, else return an invalid type.
349
350 /// Return a new CompilerType that is a pointer to this type
352
353 /// Return a new CompilerType that is a L value reference to this type if this
354 /// type is valid and the type system supports L value references, else return
355 /// an invalid type.
357
358 /// Return a new CompilerType that is a R value reference to this type if this
359 /// type is valid and the type system supports R value references, else return
360 /// an invalid type.
362
363 /// Return a new CompilerType adds a const modifier to this type if this type
364 /// is valid and the type system supports const modifiers, else return an
365 /// invalid type.
367
368 /// Return a new CompilerType adds a volatile modifier to this type if this
369 /// type is valid and the type system supports volatile modifiers, else return
370 /// an invalid type.
372
373 /// Return a new CompilerType that is the atomic type of this type. If this
374 /// type is not valid or the type system doesn't support atomic types, this
375 /// returns an invalid type.
377
378 /// Return a new CompilerType adds a restrict modifier to this type if this
379 /// type is valid and the type system supports restrict modifiers, else return
380 /// an invalid type.
382
383 /// Create a typedef to this type using "name" as the name of the typedef this
384 /// type is valid and the type system supports typedefs, else return an
385 /// invalid type.
386 /// \param payload The typesystem-specific \p lldb::Type payload.
387 CompilerType CreateTypedef(const char *name,
388 const CompilerDeclContext &decl_ctx,
389 uint32_t payload) const;
390
391 /// If the current object represents a typedef type, get the underlying type
393
394 /// Create related types using the current type's AST
396
397 /// Return a new CompilerType adds a ptrauth modifier from the given 32-bit
398 /// opaque payload to this type if this type is valid and the type system
399 /// supports ptrauth modifiers, else return an invalid type. Note that this
400 /// does not check if this type is a pointer.
401 CompilerType AddPtrAuthModifier(uint32_t payload) const;
402 /// \}
403
404 /// Exploring the type.
405 /// \{
406 struct IntegralTemplateArgument;
407
408 /// Return the size of the type in bytes.
409 llvm::Expected<uint64_t> GetByteSize(ExecutionContextScope *exe_scope) const;
410 /// Return the size of the type in bits.
411 llvm::Expected<uint64_t> GetBitSize(ExecutionContextScope *exe_scope) const;
412
414
415 lldb::Format GetFormat() const;
416
417 std::optional<size_t> GetTypeBitAlign(ExecutionContextScope *exe_scope) const;
418
419 llvm::Expected<uint32_t>
420 GetNumChildren(bool omit_empty_base_classes,
421 const ExecutionContext *exe_ctx) const;
422
424
425 /// If this type is an enumeration, iterate through all of its enumerators
426 /// using a callback. If the callback returns true, keep iterating, else abort
427 /// the iteration.
429 std::function<bool(const CompilerType &integer_type, ConstString name,
430 const llvm::APSInt &value)> const &callback) const;
431
432 uint32_t GetNumFields() const;
433
434 CompilerType GetFieldAtIndex(size_t idx, std::string &name,
435 uint64_t *bit_offset_ptr,
436 uint32_t *bitfield_bit_size_ptr,
437 bool *is_bitfield_ptr) const;
438
439 uint32_t GetNumDirectBaseClasses() const;
440
441 uint32_t GetNumVirtualBaseClasses() const;
442
444 uint32_t *bit_offset_ptr) const;
445
447 uint32_t *bit_offset_ptr) const;
448
449 CompilerDecl GetStaticFieldWithName(llvm::StringRef name) const;
450
451 llvm::Expected<CompilerType>
452 GetDereferencedType(ExecutionContext *exe_ctx, std::string &deref_name,
453 uint32_t &deref_byte_size, int32_t &deref_byte_offset,
454 ValueObject *valobj, uint64_t &language_flags) const;
455
456 llvm::Expected<CompilerType> GetChildCompilerTypeAtIndex(
457 ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers,
458 bool omit_empty_base_classes, bool ignore_array_bounds,
459 std::string &child_name, uint32_t &child_byte_size,
460 int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size,
461 uint32_t &child_bitfield_bit_offset, bool &child_is_base_class,
462 bool &child_is_deref_of_parent, ValueObject *valobj,
463 uint64_t &language_flags) const;
464
465 /// Lookup a child given a name. This function will match base class names and
466 /// member member names in "clang_type" only, not descendants.
467 llvm::Expected<uint32_t>
468 GetIndexOfChildWithName(llvm::StringRef name,
469 bool omit_empty_base_classes) const;
470
471 /// Lookup a child member given a name. This function will match member names
472 /// only and will descend into "clang_type" children in search for the first
473 /// member in this class, or any base class that matches "name".
474 ///
475 /// \param child_indexes returns an index path for the result.
476 /// \returns 0 if unsuccessful, otherwise the length of the index path.
477 ///
478 /// TODO: Return all matches for a given name by returning a
479 /// vector<vector<uint32_t>> so we catch all names that match a
480 /// given child name, not just the first.
481 size_t
482 GetIndexOfChildMemberWithName(llvm::StringRef name,
483 bool omit_empty_base_classes,
484 std::vector<uint32_t> &child_indexes) const;
485
486 CompilerType GetDirectNestedTypeWithName(llvm::StringRef name) const;
487
488 /// Return the number of template arguments the type has.
489 /// If expand_pack is true, then variadic argument packs are automatically
490 /// expanded to their supplied arguments. If it is false an argument pack
491 /// will only count as 1 argument.
492 size_t GetNumTemplateArguments(bool expand_pack = false) const;
493
494 // Return the TemplateArgumentKind of the template argument at index idx.
495 // If expand_pack is true, then variadic argument packs are automatically
496 // expanded to their supplied arguments. With expand_pack set to false, an
497 // arguement pack will count as 1 argument and return a type of Pack.
499 GetTemplateArgumentKind(size_t idx, bool expand_pack = false) const;
501 bool expand_pack = false) const;
502
503 /// Returns the value of the template argument and its type.
504 /// If expand_pack is true, then variadic argument packs are automatically
505 /// expanded to their supplied arguments. With expand_pack set to false, an
506 /// arguement pack will count as 1 argument and it is invalid to call this
507 /// method on the pack argument.
508 std::optional<IntegralTemplateArgument>
509 GetIntegralTemplateArgument(size_t idx, bool expand_pack = false) const;
510
512
513 /// If the type is promotable, returns the type promoted to a larger
514 /// integer type according to the type system rules.
515 /// \see IsPromotableIntegerType
517
519
521 /// \}
522
523 /// Dumping types.
524 /// \{
525#ifndef NDEBUG
526 /// Convenience LLVM-style dump method for use in the debugger only.
527 /// Don't call this function from actual code.
528 LLVM_DUMP_METHOD void dump() const;
529#endif
530
531 bool DumpTypeValue(Stream *s, lldb::Format format, const DataExtractor &data,
532 lldb::offset_t data_offset, size_t data_byte_size,
533 uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
534 ExecutionContextScope *exe_scope);
535
536 /// Dump to stdout.
539
540 /// Print a description of the type to a stream. The exact implementation
541 /// varies, but the expectation is that eDescriptionLevelFull returns a
542 /// source-like representation of the type, whereas eDescriptionLevelVerbose
543 /// does a dump of the underlying AST if applicable.
546 /// \}
547
548 bool GetValueAsScalar(const DataExtractor &data, lldb::offset_t data_offset,
549 size_t data_byte_size, Scalar &value,
550 ExecutionContextScope *exe_scope) const;
551 void Clear() {
552 m_type_system = {};
553 m_type = nullptr;
554 }
555
556private:
557#ifndef NDEBUG
558 /// If the type is valid, ask the TypeSystem to verify the integrity
559 /// of the type to catch CompilerTypes that mix and match invalid
560 /// TypeSystem/Opaque type pairs.
561 bool Verify() const;
562#endif
563
566};
567
568bool operator==(const CompilerType &lhs, const CompilerType &rhs);
569bool operator!=(const CompilerType &lhs, const CompilerType &rhs);
570
575
576} // namespace lldb_private
577
578#endif // LLDB_SYMBOL_COMPILERTYPE_H
Represents a generic declaration context in a program.
Represents a generic declaration such as a function declaration.
This is a minimal wrapper of a TypeSystem shared pointer as returned by CompilerType which conventien...
bool operator!=(const TypeSystemSPWrapper &other) const
bool operator==(const TypeSystemSPWrapper &other) const
std::shared_ptr< TypeSystemType > dyn_cast_or_null()
Return a shared_ptr<TypeSystemType> if dyn_cast succeeds.
TypeSystem * operator->() const
Only to be used in a one-off situations like if (typesystem && typesystem->method()) Do not store thi...
TypeSystemSPWrapper(lldb::TypeSystemSP typesystem_sp)
Generic representation of a type in a programming language.
uint32_t GetNumberOfNonEmptyBaseClasses()
Go through the base classes and count non-empty ones.
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...
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 GetBasicTypeFromAST(lldb::BasicType basic_type) const
Create related types using the current type's AST.
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
void SetCompilerType(lldb::TypeSystemWP type_system, lldb::opaque_compiler_type_t type)
CompilerType AddConstModifier() const
Return a new CompilerType adds a const modifier to this type if this type is valid and the type syste...
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
CompilerType GetRValueReferenceType() const
Return a new CompilerType that is a R value reference to this type if this type is valid and the type...
bool IsIntegerOrUnscopedEnumerationType() const
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.
bool IsScalarOrUnscopedEnumerationType() const
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
bool IsContextuallyConvertibleToBool() const
This may only be defined in TypeSystemClang.
llvm::Expected< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
CompilerDecl GetStaticFieldWithName(llvm::StringRef name) const
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...
bool IsVirtualBase(CompilerType target_base, CompilerType *virtual_base, bool carry_virtual=false) const
Checks whether target_base is a virtual base of type (direct or indirect).
CompilerType AddRestrictModifier() const
Return a new CompilerType adds a restrict modifier to this type if this type is valid and the type sy...
lldb::TypeSystemWP m_type_system
CompilerType GetDirectNestedTypeWithName(llvm::StringRef name) const
bool GetPtrAuthAddressDiversity() const
uint32_t GetNumVirtualBaseClasses() const
lldb::Encoding GetEncoding() const
size_t GetPointerByteSize() const
AST related queries.
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
CompilerType(const CompilerType &rhs)
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.
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
bool IsPromotableIntegerType() const
Checks if the type is eligible for integral promotion.
size_t GetNumberOfFunctionArguments() const
bool IsVariadicFunctionType() 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
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr=nullptr) const
ConstString GetTypeName(bool BaseOnly=false) const
bool IsEnumerationIntegerTypeSigned() const
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)
CompilerType GetArrayElementType(ExecutionContextScope *exe_scope) const
Creating related types.
bool IsInteger() const
This is used when you don't care about the signedness of the integer.
llvm::Expected< CompilerType > GetDereferencedType(ExecutionContext *exe_ctx, std::string &deref_name, uint32_t &deref_byte_size, int32_t &deref_byte_offset, ValueObject *valobj, uint64_t &language_flags) const
bool operator<(const CompilerType &rhs) const
lldb::Format GetFormat() const
CompilerType GetFullyUnqualifiedType() const
ConstString GetMangledTypeName() const
unsigned GetTypeQualifiers() const
llvm::Expected< 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 GetDirectBaseClassAtIndex(size_t idx, uint32_t *bit_offset_ptr) const
std::optional< size_t > GetTypeBitAlign(ExecutionContextScope *exe_scope) 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.
bool IsUnscopedEnumerationType() const
bool IsFloatingPointType() const
Returns true for floating point types (including complex floats).
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 ...
llvm::Expected< uint32_t > GetIndexOfChildWithName(llvm::StringRef name, bool omit_empty_base_classes) const
Lookup a child given a name.
unsigned GetPtrAuthDiscriminator() const
bool IsRealFloatingPointType() const
Returns true for non-complex float types.
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
CompilerType GetEnumerationIntegerType() const
const CompilerType & operator=(const CompilerType &rhs)
Operators.
lldb::opaque_compiler_type_t m_type
bool CompareTypes(CompilerType rhs) const
llvm::Expected< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
std::shared_ptr< TypeSystemType > GetTypeSystem() const
bool IsEnumerationType() const
This is used when you don't care about the signedness of the enum.
unsigned GetPtrAuthKey() const
CompilerType GetPromotedIntegerType() const
If the type is promotable, returns the type promoted to a larger integer type according to the type s...
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...
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.
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
CompilerType(lldb::TypeSystemWP type_system, lldb::opaque_compiler_type_t type)
Creates a CompilerType with the given TypeSystem and opaque compiler type.
bool IsPointerType(CompilerType *pointee_type=nullptr) const
CompilerType AddPtrAuthModifier(uint32_t payload) const
Return a new CompilerType adds a ptrauth modifier from the given 32-bit opaque payload to this type i...
A uniqued constant string class.
Definition ConstString.h:40
An data extractor 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.
Definition Stream.h:28
Interface for representing a type system.
Definition TypeSystem.h:70
A class that represents a running process on the host machine.
bool operator!=(const Address &lhs, const Address &rhs)
Definition Address.cpp:1016
bool operator==(const Address &lhs, const Address &rhs)
Definition Address.cpp:1010
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
void * opaque_compiler_type_t
Definition lldb-types.h:90
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelFull
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Format
Display format definitions.
uint64_t offset_t
Definition lldb-types.h:85
LanguageType
Programming language type.
Encoding
Register encoding definitions.
std::weak_ptr< lldb_private::TypeSystem > TypeSystemWP