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 IsFloatingPointType(uint32_t &count, bool &is_complex) const;
148
149 bool IsFunctionType() const;
150
151 uint32_t IsHomogeneousAggregate(CompilerType *base_type_ptr) const;
152
153 size_t GetNumberOfFunctionArguments() const;
154
155 CompilerType GetFunctionArgumentAtIndex(const size_t index) const;
156
158
159 bool IsFunctionPointerType() const;
160
161 bool IsMemberFunctionPointerType() const;
162
163 bool
164 IsBlockPointerType(CompilerType *function_pointer_type_ptr = nullptr) const;
165
166 bool IsIntegerType(bool &is_signed) const;
167
168 bool IsEnumerationType(bool &is_signed) const;
169
170 bool IsIntegerOrEnumerationType(bool &is_signed) const;
171
172 bool IsPolymorphicClass() const;
173
174 /// \param target_type Can pass nullptr.
175 bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus,
176 bool check_objc) const;
177
178 bool IsPointerToScalarType() const;
179
180 bool IsRuntimeGeneratedType() const;
181
182 bool IsPointerType(CompilerType *pointee_type = nullptr) const;
183
184 bool IsPointerOrReferenceType(CompilerType *pointee_type = nullptr) const;
185
186 bool IsReferenceType(CompilerType *pointee_type = nullptr,
187 bool *is_rvalue = nullptr) const;
188
190
191 bool IsScalarType() const;
192
193 bool IsTemplateType() const;
194
195 bool IsTypedefType() const;
196
197 bool IsVoidType() const;
198
199 /// This is used when you don't care about the signedness of the integer.
200 bool IsInteger() const;
201
202 bool IsFloat() const;
203
204 /// This is used when you don't care about the signedness of the enum.
205 bool IsEnumerationType() const;
206
207 bool IsUnscopedEnumerationType() const;
208
210
211 bool IsSigned() const;
212
213 bool IsNullPtrType() const;
214
215 bool IsBoolean() const;
216
218
220
221 bool IsPromotableIntegerType() const;
222
223 bool IsPointerToVoid() const;
224
225 bool IsRecordType() const;
226
227 //// Checks whether `target_base` is a virtual base of `type` (direct or
228 /// indirect). If it is, stores the first virtual base type on the path from
229 /// `type` to `target_type`. Parameter "virtual_base" is where the first
230 /// virtual base type gets stored. Parameter "carry_virtual" is used to
231 /// denote that we're in a recursive check of virtual base classes and we
232 /// have already seen a virtual base class (so should only check direct
233 /// base classes).
234 /// Note: This may only be defined in TypeSystemClang.
235 bool IsVirtualBase(CompilerType target_base, CompilerType *virtual_base,
236 bool carry_virtual = false) const;
237
238 /// This may only be defined in TypeSystemClang.
240
241 bool IsBasicType() const;
242
243 std::string TypeDescription();
244
245 bool CompareTypes(CompilerType rhs) const;
246
247 const char *GetTypeTag();
248
249 /// Go through the base classes and count non-empty ones.
251
252 /// \}
253
254 /// Type Completion.
255 /// \{
256 bool GetCompleteType() const;
257 /// \}
258
259 bool IsForcefullyCompleted() const;
260
261 /// AST related queries.
262 /// \{
263 size_t GetPointerByteSize() const;
264 /// \}
265
266 unsigned GetPtrAuthKey() const;
267
268 unsigned GetPtrAuthDiscriminator() const;
269
270 bool GetPtrAuthAddressDiversity() const;
271
272 /// Accessors.
273 /// \{
274
275 /// Returns a shared pointer to the type system. The
276 /// TypeSystem::TypeSystemSPWrapper can be compared for equality.
278
279 template <typename TypeSystemType>
280 std::shared_ptr<TypeSystemType> GetTypeSystem() const {
281 return GetTypeSystem().dyn_cast_or_null<TypeSystemType>();
282 }
283
284 ConstString GetTypeName(bool BaseOnly = false) const;
285
287
289
290 uint32_t
291 GetTypeInfo(CompilerType *pointee_or_element_compiler_type = nullptr) const;
292
294
296
297 lldb::TypeClass GetTypeClass() const;
298
299 void SetCompilerType(lldb::TypeSystemWP type_system,
301 void SetCompilerType(TypeSystemSPWrapper type_system,
303
304 unsigned GetTypeQualifiers() const;
305 /// \}
306
307 /// Creating related types.
308 /// \{
310
311 CompilerType GetArrayType(uint64_t size) const;
312
314
316
318
319 /// Returns -1 if this isn't a function of if the function doesn't
320 /// have a prototype Returns a value >= 0 if there is a prototype.
321 int GetFunctionArgumentCount() const;
322
324
326
327 size_t GetNumMemberFunctions() const;
328
330
331 /// If this type is a reference to a type (L value or R value reference),
332 /// return a new type with the reference removed, else return the current type
333 /// itself.
335
336 /// If this type is a pointer type, return the type that the pointer points
337 /// to, else return an invalid type.
339
340 /// Return a new CompilerType that is a pointer to this type
342
343 /// Return a new CompilerType that is a L value reference to this type if this
344 /// type is valid and the type system supports L value references, else return
345 /// an invalid type.
347
348 /// Return a new CompilerType that is a R value reference to this type if this
349 /// type is valid and the type system supports R value references, else return
350 /// an invalid type.
352
353 /// Return a new CompilerType adds a const modifier to this type if this type
354 /// is valid and the type system supports const modifiers, else return an
355 /// invalid type.
357
358 /// Return a new CompilerType adds a volatile modifier to this type if this
359 /// type is valid and the type system supports volatile modifiers, else return
360 /// an invalid type.
362
363 /// Return a new CompilerType that is the atomic type of this type. If this
364 /// type is not valid or the type system doesn't support atomic types, this
365 /// returns an invalid type.
367
368 /// Return a new CompilerType adds a restrict modifier to this type if this
369 /// type is valid and the type system supports restrict modifiers, else return
370 /// an invalid type.
372
373 /// Create a typedef to this type using "name" as the name of the typedef this
374 /// type is valid and the type system supports typedefs, else return an
375 /// invalid type.
376 /// \param payload The typesystem-specific \p lldb::Type payload.
377 CompilerType CreateTypedef(const char *name,
378 const CompilerDeclContext &decl_ctx,
379 uint32_t payload) const;
380
381 /// If the current object represents a typedef type, get the underlying type
383
384 /// Create related types using the current type's AST
386
387 /// Return a new CompilerType adds a ptrauth modifier from the given 32-bit
388 /// opaque payload to this type if this type is valid and the type system
389 /// supports ptrauth modifiers, else return an invalid type. Note that this
390 /// does not check if this type is a pointer.
391 CompilerType AddPtrAuthModifier(uint32_t payload) const;
392 /// \}
393
394 /// Exploring the type.
395 /// \{
396 struct IntegralTemplateArgument;
397
398 /// Return the size of the type in bytes.
399 llvm::Expected<uint64_t> GetByteSize(ExecutionContextScope *exe_scope) const;
400 /// Return the size of the type in bits.
401 llvm::Expected<uint64_t> GetBitSize(ExecutionContextScope *exe_scope) const;
402
403 lldb::Encoding GetEncoding(uint64_t &count) const;
404
405 lldb::Format GetFormat() const;
406
407 std::optional<size_t> GetTypeBitAlign(ExecutionContextScope *exe_scope) const;
408
409 llvm::Expected<uint32_t>
410 GetNumChildren(bool omit_empty_base_classes,
411 const ExecutionContext *exe_ctx) const;
412
414
415 /// If this type is an enumeration, iterate through all of its enumerators
416 /// using a callback. If the callback returns true, keep iterating, else abort
417 /// the iteration.
419 std::function<bool(const CompilerType &integer_type, ConstString name,
420 const llvm::APSInt &value)> const &callback) const;
421
422 uint32_t GetNumFields() const;
423
424 CompilerType GetFieldAtIndex(size_t idx, std::string &name,
425 uint64_t *bit_offset_ptr,
426 uint32_t *bitfield_bit_size_ptr,
427 bool *is_bitfield_ptr) const;
428
429 uint32_t GetNumDirectBaseClasses() const;
430
431 uint32_t GetNumVirtualBaseClasses() const;
432
434 uint32_t *bit_offset_ptr) const;
435
437 uint32_t *bit_offset_ptr) const;
438
439 CompilerDecl GetStaticFieldWithName(llvm::StringRef name) const;
440
441 llvm::Expected<CompilerType>
442 GetDereferencedType(ExecutionContext *exe_ctx, std::string &deref_name,
443 uint32_t &deref_byte_size, int32_t &deref_byte_offset,
444 ValueObject *valobj, uint64_t &language_flags) const;
445
446 llvm::Expected<CompilerType> GetChildCompilerTypeAtIndex(
447 ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers,
448 bool omit_empty_base_classes, bool ignore_array_bounds,
449 std::string &child_name, uint32_t &child_byte_size,
450 int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size,
451 uint32_t &child_bitfield_bit_offset, bool &child_is_base_class,
452 bool &child_is_deref_of_parent, ValueObject *valobj,
453 uint64_t &language_flags) const;
454
455 /// Lookup a child given a name. This function will match base class names and
456 /// member member names in "clang_type" only, not descendants.
457 llvm::Expected<uint32_t>
458 GetIndexOfChildWithName(llvm::StringRef name,
459 bool omit_empty_base_classes) const;
460
461 /// Lookup a child member given a name. This function will match member names
462 /// only and will descend into "clang_type" children in search for the first
463 /// member in this class, or any base class that matches "name".
464 ///
465 /// \param child_indexes returns an index path for the result.
466 /// \returns 0 if unsuccessful, otherwise the length of the index path.
467 ///
468 /// TODO: Return all matches for a given name by returning a
469 /// vector<vector<uint32_t>> so we catch all names that match a
470 /// given child name, not just the first.
471 size_t
472 GetIndexOfChildMemberWithName(llvm::StringRef name,
473 bool omit_empty_base_classes,
474 std::vector<uint32_t> &child_indexes) const;
475
476 CompilerType GetDirectNestedTypeWithName(llvm::StringRef name) const;
477
478 /// Return the number of template arguments the type has.
479 /// If expand_pack is true, then variadic argument packs are automatically
480 /// expanded to their supplied arguments. If it is false an argument pack
481 /// will only count as 1 argument.
482 size_t GetNumTemplateArguments(bool expand_pack = false) const;
483
484 // Return the TemplateArgumentKind of the template argument at index idx.
485 // If expand_pack is true, then variadic argument packs are automatically
486 // expanded to their supplied arguments. With expand_pack set to false, an
487 // arguement pack will count as 1 argument and return a type of Pack.
489 GetTemplateArgumentKind(size_t idx, bool expand_pack = false) const;
491 bool expand_pack = false) const;
492
493 /// Returns the value of the template argument and its type.
494 /// If expand_pack is true, then variadic argument packs are automatically
495 /// expanded to their supplied arguments. With expand_pack set to false, an
496 /// arguement pack will count as 1 argument and it is invalid to call this
497 /// method on the pack argument.
498 std::optional<IntegralTemplateArgument>
499 GetIntegralTemplateArgument(size_t idx, bool expand_pack = false) const;
500
502
504
506 /// \}
507
508 /// Dumping types.
509 /// \{
510#ifndef NDEBUG
511 /// Convenience LLVM-style dump method for use in the debugger only.
512 /// Don't call this function from actual code.
513 LLVM_DUMP_METHOD void dump() const;
514#endif
515
516 bool DumpTypeValue(Stream *s, lldb::Format format, const DataExtractor &data,
517 lldb::offset_t data_offset, size_t data_byte_size,
518 uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
519 ExecutionContextScope *exe_scope);
520
521 /// Dump to stdout.
524
525 /// Print a description of the type to a stream. The exact implementation
526 /// varies, but the expectation is that eDescriptionLevelFull returns a
527 /// source-like representation of the type, whereas eDescriptionLevelVerbose
528 /// does a dump of the underlying AST if applicable.
531 /// \}
532
533 bool GetValueAsScalar(const DataExtractor &data, lldb::offset_t data_offset,
534 size_t data_byte_size, Scalar &value,
535 ExecutionContextScope *exe_scope) const;
536 void Clear() {
537 m_type_system = {};
538 m_type = nullptr;
539 }
540
541private:
542#ifndef NDEBUG
543 /// If the type is valid, ask the TypeSystem to verify the integrity
544 /// of the type to catch CompilerTypes that mix and match invalid
545 /// TypeSystem/Opaque type pairs.
546 bool Verify() const;
547#endif
548
551};
552
553bool operator==(const CompilerType &lhs, const CompilerType &rhs);
554bool operator!=(const CompilerType &lhs, const CompilerType &rhs);
555
560
561} // namespace lldb_private
562
563#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...
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
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
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.
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 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
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
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:1017
bool operator==(const Address &lhs, const Address &rhs)
Definition Address.cpp:1011
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
void * opaque_compiler_type_t
Definition lldb-types.h:89
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