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