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 bool IsPromotableIntegerType() const;
230
231 bool IsPointerToVoid() const;
232
233 bool IsRecordType() const;
234
235 //// Checks whether `target_base` is a virtual base of `type` (direct or
236 /// indirect). If it is, stores the first virtual base type on the path from
237 /// `type` to `target_type`. Parameter "virtual_base" is where the first
238 /// virtual base type gets stored. Parameter "carry_virtual" is used to
239 /// denote that we're in a recursive check of virtual base classes and we
240 /// have already seen a virtual base class (so should only check direct
241 /// base classes).
242 /// Note: This may only be defined in TypeSystemClang.
243 bool IsVirtualBase(CompilerType target_base, CompilerType *virtual_base,
244 bool carry_virtual = false) const;
245
246 /// This may only be defined in TypeSystemClang.
248
249 bool IsBasicType() const;
250
251 std::string TypeDescription();
252
253 bool CompareTypes(CompilerType rhs) const;
254
255 const char *GetTypeTag();
256
257 /// Go through the base classes and count non-empty ones.
259
260 /// \}
261
262 /// Type Completion.
263 /// \{
264 bool GetCompleteType() const;
265 /// \}
266
267 bool IsForcefullyCompleted() const;
268
269 /// AST related queries.
270 /// \{
271 size_t GetPointerByteSize() const;
272 /// \}
273
274 unsigned GetPtrAuthKey() const;
275
276 unsigned GetPtrAuthDiscriminator() const;
277
278 bool GetPtrAuthAddressDiversity() const;
279
280 /// Accessors.
281 /// \{
282
283 /// Returns a shared pointer to the type system. The
284 /// TypeSystem::TypeSystemSPWrapper can be compared for equality.
286
287 template <typename TypeSystemType>
288 std::shared_ptr<TypeSystemType> GetTypeSystem() const {
289 return GetTypeSystem().dyn_cast_or_null<TypeSystemType>();
290 }
291
292 ConstString GetTypeName(bool BaseOnly = false) const;
293
295
297
298 uint32_t
299 GetTypeInfo(CompilerType *pointee_or_element_compiler_type = nullptr) const;
300
302
304
305 lldb::TypeClass GetTypeClass() const;
306
307 void SetCompilerType(lldb::TypeSystemWP type_system,
309 void SetCompilerType(TypeSystemSPWrapper type_system,
311
312 unsigned GetTypeQualifiers() const;
313 /// \}
314
315 /// Creating related types.
316 /// \{
318
319 CompilerType GetArrayType(uint64_t size) const;
320
322
324
326
327 /// Returns -1 if this isn't a function of if the function doesn't
328 /// have a prototype Returns a value >= 0 if there is a prototype.
329 int GetFunctionArgumentCount() const;
330
332
334
335 size_t GetNumMemberFunctions() const;
336
338
339 /// If this type is a reference to a type (L value or R value reference),
340 /// return a new type with the reference removed, else return the current type
341 /// itself.
343
344 /// If this type is a pointer type, return the type that the pointer points
345 /// to, else return an invalid type.
347
348 /// Return a new CompilerType that is a pointer to this type
350
351 /// Return a new CompilerType that is a L value reference to this type if this
352 /// type is valid and the type system supports L value references, else return
353 /// an invalid type.
355
356 /// Return a new CompilerType that is a R value reference to this type if this
357 /// type is valid and the type system supports R value references, else return
358 /// an invalid type.
360
361 /// Return a new CompilerType adds a const modifier to this type if this type
362 /// is valid and the type system supports const modifiers, else return an
363 /// invalid type.
365
366 /// Return a new CompilerType adds a volatile modifier to this type if this
367 /// type is valid and the type system supports volatile modifiers, else return
368 /// an invalid type.
370
371 /// Return a new CompilerType that is the atomic type of this type. If this
372 /// type is not valid or the type system doesn't support atomic types, this
373 /// returns an invalid type.
375
376 /// Return a new CompilerType adds a restrict modifier to this type if this
377 /// type is valid and the type system supports restrict modifiers, else return
378 /// an invalid type.
380
381 /// Create a typedef to this type using "name" as the name of the typedef this
382 /// type is valid and the type system supports typedefs, else return an
383 /// invalid type.
384 /// \param payload The typesystem-specific \p lldb::Type payload.
385 CompilerType CreateTypedef(const char *name,
386 const CompilerDeclContext &decl_ctx,
387 uint32_t payload) const;
388
389 /// If the current object represents a typedef type, get the underlying type
391
392 /// Create related types using the current type's AST
394
395 /// Return a new CompilerType adds a ptrauth modifier from the given 32-bit
396 /// opaque payload to this type if this type is valid and the type system
397 /// supports ptrauth modifiers, else return an invalid type. Note that this
398 /// does not check if this type is a pointer.
399 CompilerType AddPtrAuthModifier(uint32_t payload) const;
400 /// \}
401
402 /// Exploring the type.
403 /// \{
404 struct IntegralTemplateArgument;
405
406 /// Return the size of the type in bytes.
407 llvm::Expected<uint64_t> GetByteSize(ExecutionContextScope *exe_scope) const;
408 /// Return the size of the type in bits.
409 llvm::Expected<uint64_t> GetBitSize(ExecutionContextScope *exe_scope) const;
410
412
413 lldb::Format GetFormat() const;
414
415 std::optional<size_t> GetTypeBitAlign(ExecutionContextScope *exe_scope) const;
416
417 llvm::Expected<uint32_t>
418 GetNumChildren(bool omit_empty_base_classes,
419 const ExecutionContext *exe_ctx) const;
420
422
423 /// If this type is an enumeration, iterate through all of its enumerators
424 /// using a callback. If the callback returns true, keep iterating, else abort
425 /// the iteration.
427 std::function<bool(const CompilerType &integer_type, ConstString name,
428 const llvm::APSInt &value)> const &callback) const;
429
430 uint32_t GetNumFields() const;
431
432 CompilerType GetFieldAtIndex(size_t idx, std::string &name,
433 uint64_t *bit_offset_ptr,
434 uint32_t *bitfield_bit_size_ptr,
435 bool *is_bitfield_ptr) const;
436
437 uint32_t GetNumDirectBaseClasses() const;
438
439 uint32_t GetNumVirtualBaseClasses() const;
440
442 uint32_t *bit_offset_ptr) const;
443
445 uint32_t *bit_offset_ptr) const;
446
447 CompilerDecl GetStaticFieldWithName(llvm::StringRef name) const;
448
449 llvm::Expected<CompilerType>
450 GetDereferencedType(ExecutionContext *exe_ctx, std::string &deref_name,
451 uint32_t &deref_byte_size, int32_t &deref_byte_offset,
452 ValueObject *valobj, uint64_t &language_flags) const;
453
454 llvm::Expected<CompilerType> GetChildCompilerTypeAtIndex(
455 ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers,
456 bool omit_empty_base_classes, bool ignore_array_bounds,
457 std::string &child_name, uint32_t &child_byte_size,
458 int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size,
459 uint32_t &child_bitfield_bit_offset, bool &child_is_base_class,
460 bool &child_is_deref_of_parent, ValueObject *valobj,
461 uint64_t &language_flags) const;
462
463 /// Lookup a child given a name. This function will match base class names and
464 /// member member names in "clang_type" only, not descendants.
465 llvm::Expected<uint32_t>
466 GetIndexOfChildWithName(llvm::StringRef name,
467 bool omit_empty_base_classes) const;
468
469 /// Lookup a child member given a name. This function will match member names
470 /// only and will descend into "clang_type" children in search for the first
471 /// member in this class, or any base class that matches "name".
472 ///
473 /// \param child_indexes returns an index path for the result.
474 /// \returns 0 if unsuccessful, otherwise the length of the index path.
475 ///
476 /// TODO: Return all matches for a given name by returning a
477 /// vector<vector<uint32_t>> so we catch all names that match a
478 /// given child name, not just the first.
479 size_t
480 GetIndexOfChildMemberWithName(llvm::StringRef name,
481 bool omit_empty_base_classes,
482 std::vector<uint32_t> &child_indexes) const;
483
484 CompilerType GetDirectNestedTypeWithName(llvm::StringRef name) const;
485
486 /// Return the number of template arguments the type has.
487 /// If expand_pack is true, then variadic argument packs are automatically
488 /// expanded to their supplied arguments. If it is false an argument pack
489 /// will only count as 1 argument.
490 size_t GetNumTemplateArguments(bool expand_pack = false) const;
491
492 // Return the TemplateArgumentKind of the template argument at index idx.
493 // If expand_pack is true, then variadic argument packs are automatically
494 // expanded to their supplied arguments. With expand_pack set to false, an
495 // arguement pack will count as 1 argument and return a type of Pack.
497 GetTemplateArgumentKind(size_t idx, bool expand_pack = false) const;
499 bool expand_pack = false) const;
500
501 /// Returns the value of the template argument and its type.
502 /// If expand_pack is true, then variadic argument packs are automatically
503 /// expanded to their supplied arguments. With expand_pack set to false, an
504 /// arguement pack will count as 1 argument and it is invalid to call this
505 /// method on the pack argument.
506 std::optional<IntegralTemplateArgument>
507 GetIntegralTemplateArgument(size_t idx, bool expand_pack = false) const;
508
510
512
514 /// \}
515
516 /// Dumping types.
517 /// \{
518#ifndef NDEBUG
519 /// Convenience LLVM-style dump method for use in the debugger only.
520 /// Don't call this function from actual code.
521 LLVM_DUMP_METHOD void dump() const;
522#endif
523
524 bool DumpTypeValue(Stream *s, lldb::Format format, const DataExtractor &data,
525 lldb::offset_t data_offset, size_t data_byte_size,
526 uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
527 ExecutionContextScope *exe_scope);
528
529 /// Dump to stdout.
532
533 /// Print a description of the type to a stream. The exact implementation
534 /// varies, but the expectation is that eDescriptionLevelFull returns a
535 /// source-like representation of the type, whereas eDescriptionLevelVerbose
536 /// does a dump of the underlying AST if applicable.
539 /// \}
540
541 bool GetValueAsScalar(const DataExtractor &data, lldb::offset_t data_offset,
542 size_t data_byte_size, Scalar &value,
543 ExecutionContextScope *exe_scope) const;
544 void Clear() {
545 m_type_system = {};
546 m_type = nullptr;
547 }
548
549private:
550#ifndef NDEBUG
551 /// If the type is valid, ask the TypeSystem to verify the integrity
552 /// of the type to catch CompilerTypes that mix and match invalid
553 /// TypeSystem/Opaque type pairs.
554 bool Verify() const;
555#endif
556
559};
560
561bool operator==(const CompilerType &lhs, const CompilerType &rhs);
562bool operator!=(const CompilerType &lhs, const CompilerType &rhs);
563
568
569} // namespace lldb_private
570
571#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
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 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