LLDB mainline
Type.h
Go to the documentation of this file.
1//===-- Type.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_TYPE_H
10#define LLDB_SYMBOL_TYPE_H
11
16#include "lldb/Utility/UserID.h"
17#include "lldb/lldb-private.h"
18
19#include "llvm/ADT/APSInt.h"
20
21#include <optional>
22#include <set>
23
24namespace lldb_private {
25class SymbolFileCommon;
26
27/// CompilerContext allows an array of these items to be passed to perform
28/// detailed lookups in SymbolVendor and SymbolFile functions.
31
32 bool operator==(const CompilerContext &rhs) const {
33 return kind == rhs.kind && name == rhs.name;
34 }
35 bool operator!=(const CompilerContext &rhs) const { return !(*this == rhs); }
36
37 void Dump() const;
38
41};
42
43/// Match \p context_chain against \p pattern, which may contain "Any"
44/// kinds. The \p context_chain should *not* contain any "Any" kinds.
45bool contextMatches(llvm::ArrayRef<CompilerContext> context_chain,
46 llvm::ArrayRef<CompilerContext> pattern);
47
48class SymbolFileType : public std::enable_shared_from_this<SymbolFileType>,
49 public UserID {
50public:
52 : UserID(uid), m_symbol_file(symbol_file) {}
53
54 SymbolFileType(SymbolFile &symbol_file, const lldb::TypeSP &type_sp);
55
56 ~SymbolFileType() = default;
57
58 Type *operator->() { return GetType(); }
59
60 Type *GetType();
62
63protected:
65 lldb::TypeSP m_type_sp;
66};
67
68class Type : public std::enable_shared_from_this<Type>, public UserID {
69public:
71 /// Invalid encoding.
73 /// This type is the type whose UID is m_encoding_uid.
75 /// This type is the type whose UID is m_encoding_uid with the const
76 /// qualifier added.
78 /// This type is the type whose UID is m_encoding_uid with the restrict
79 /// qualifier added.
81 /// This type is the type whose UID is m_encoding_uid with the volatile
82 /// qualifier added.
84 /// This type is alias to a type whose UID is m_encoding_uid.
86 /// This type is pointer to a type whose UID is m_encoding_uid.
88 /// This type is L value reference to a type whose UID is m_encoding_uid.
90 /// This type is R value reference to a type whose UID is m_encoding_uid.
92 /// This type is the type whose UID is m_encoding_uid as an atomic type.
94 /// This type is the synthetic type whose UID is m_encoding_uid.
96 };
97
98 enum class ResolveState : unsigned char {
99 Unresolved = 0,
100 Forward = 1,
101 Layout = 2,
102 Full = 3
103 };
104
105 void Dump(Stream *s, bool show_context,
107
108 void DumpTypeName(Stream *s);
109
110 /// Since Type instances only keep a "SymbolFile *" internally, other classes
111 /// like TypeImpl need make sure the module is still around before playing
112 /// with
113 /// Type instances. They can store a weak pointer to the Module;
114 lldb::ModuleSP GetModule();
115
116 /// GetModule may return module for compile unit's object file.
117 /// GetExeModule returns module for executable object file that contains
118 /// compile unit where type was actually defined.
119 /// GetModule and GetExeModule may return the same value.
120 lldb::ModuleSP GetExeModule();
121
122 void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name,
123 ExecutionContextScope *exe_scope);
124
126 const SymbolFile *GetSymbolFile() const { return m_symbol_file; }
127
129
131
132 std::optional<uint64_t> GetByteSize(ExecutionContextScope *exe_scope);
133
134 uint32_t GetNumChildren(bool omit_empty_base_classes);
135
136 bool IsAggregateType();
137
138 // Returns if the type is a templated decl. Does not look through typedefs.
139 bool IsTemplateType();
140
142
144
145 lldb::TypeSP GetTypedefType();
146
147 ConstString GetName() const { return m_name; }
148
150
151 void DumpValue(ExecutionContext *exe_ctx, Stream *s,
152 const DataExtractor &data, uint32_t data_offset,
153 bool show_type, bool show_summary, bool verbose,
155
156 bool DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s,
157 lldb::addr_t address, AddressType address_type,
158 bool show_types, bool show_summary, bool verbose);
159
160 bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address,
161 AddressType address_type, DataExtractor &data);
162
163 bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address,
164 AddressType address_type, DataExtractor &data);
165
167
168 lldb::Encoding GetEncoding(uint64_t &count);
169
173 m_context = context;
174 }
175
177
178 // Get the clang type, and resolve definitions for any
179 // class/struct/union/enum types completely.
181
182 // Get the clang type, and resolve definitions enough so that the type could
183 // have layout performed. This allows ptrs and refs to
184 // class/struct/union/enum types remain forward declarations.
186
187 // Get the clang type and leave class/struct/union/enum types as forward
188 // declarations if they haven't already been fully defined.
190
191 static int Compare(const Type &a, const Type &b);
192
193 // From a fully qualified typename, split the type into the type basename and
194 // the remaining type scope (namespaces/classes).
195 static bool GetTypeScopeAndBasename(llvm::StringRef name,
196 llvm::StringRef &scope,
197 llvm::StringRef &basename,
198 lldb::TypeClass &type_class);
199 void SetEncodingType(Type *encoding_type) { m_encoding_type = encoding_type; }
200
202
204 /// Return the language-specific payload.
206 /// Return the language-specific payload.
207 void SetPayload(Payload opaque_payload) { m_payload = opaque_payload; }
208
209protected:
212 /// The symbol context in which this type is defined.
217 uint64_t m_byte_size : 63;
222 /// Language-specific flags.
224
226
227 bool ResolveCompilerType(ResolveState compiler_type_resolve_state);
228private:
229 /// Only allow Symbol File to create types, as they should own them by keeping
230 /// them in their TypeList. \see SymbolFileCommon::MakeType() reference in the
231 /// header documentation here so users will know what function to use if the
232 /// get a compile error.
234
235 Type(lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name,
236 std::optional<uint64_t> byte_size, SymbolContextScope *context,
237 lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type,
238 const Declaration &decl, const CompilerType &compiler_qual_type,
239 ResolveState compiler_type_resolve_state, uint32_t opaque_payload = 0);
240
241 // This makes an invalid type. Used for functions that return a Type when
242 // they get an error.
243 Type();
244
245 Type(Type &t) = default;
246
247 Type(Type &&t) = default;
248
249 Type &operator=(const Type &t) = default;
250
251 Type &operator=(Type &&t) = default;
252};
253
254// the two classes here are used by the public API as a backend to the SBType
255// and SBTypeList classes
256
257class TypeImpl {
258public:
259 TypeImpl() = default;
260
261 ~TypeImpl() = default;
262
263 TypeImpl(const lldb::TypeSP &type_sp);
264
265 TypeImpl(const CompilerType &compiler_type);
266
267 TypeImpl(const lldb::TypeSP &type_sp, const CompilerType &dynamic);
268
269 TypeImpl(const CompilerType &compiler_type, const CompilerType &dynamic);
270
271 void SetType(const lldb::TypeSP &type_sp);
272
273 void SetType(const CompilerType &compiler_type);
274
275 void SetType(const lldb::TypeSP &type_sp, const CompilerType &dynamic);
276
277 void SetType(const CompilerType &compiler_type, const CompilerType &dynamic);
278
279 bool operator==(const TypeImpl &rhs) const;
280
281 bool operator!=(const TypeImpl &rhs) const;
282
283 bool IsValid() const;
284
285 explicit operator bool() const;
286
287 void Clear();
288
289 lldb::ModuleSP GetModule() const;
290
291 ConstString GetName() const;
292
294
295 TypeImpl GetPointerType() const;
296
297 TypeImpl GetPointeeType() const;
298
300
302
304
306
308
309 CompilerType GetCompilerType(bool prefer_dynamic);
310
312
314 lldb::DescriptionLevel description_level);
315
316private:
317 bool CheckModule(lldb::ModuleSP &module_sp) const;
318 bool CheckExeModule(lldb::ModuleSP &module_sp) const;
319 bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp,
320 lldb::ModuleSP &module_sp) const;
321
322 lldb::ModuleWP m_module_wp;
323 lldb::ModuleWP m_exe_module_wp;
326};
327
329public:
330 TypeListImpl() = default;
331
332 void Append(const lldb::TypeImplSP &type) { m_content.push_back(type); }
333
335 public:
336 AppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
337
338 void operator()(const lldb::TypeImplSP &type) { m_type_list.Append(type); }
339
340 private:
342 };
343
344 void Append(const lldb_private::TypeList &type_list);
345
346 lldb::TypeImplSP GetTypeAtIndex(size_t idx) {
347 lldb::TypeImplSP type_sp;
348 if (idx < GetSize())
349 type_sp = m_content[idx];
350 return type_sp;
351 }
352
353 size_t GetSize() { return m_content.size(); }
354
355private:
356 std::vector<lldb::TypeImplSP> m_content;
357};
358
360public:
361 TypeMemberImpl() = default;
362
363 TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset,
364 ConstString name, uint32_t bitfield_bit_size = 0,
365 bool is_bitfield = false)
366 : m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset), m_name(name),
367 m_bitfield_bit_size(bitfield_bit_size), m_is_bitfield(is_bitfield) {}
368
369 TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
370 : m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset),
372 if (m_type_impl_sp)
373 m_name = m_type_impl_sp->GetName();
374 }
375
376 const lldb::TypeImplSP &GetTypeImpl() { return m_type_impl_sp; }
377
378 ConstString GetName() const { return m_name; }
379
380 uint64_t GetBitOffset() const { return m_bit_offset; }
381
383
384 void SetBitfieldBitSize(uint32_t bitfield_bit_size) {
385 m_bitfield_bit_size = bitfield_bit_size;
386 }
387
388 bool GetIsBitfield() const { return m_is_bitfield; }
389
390 void SetIsBitfield(bool is_bitfield) { m_is_bitfield = is_bitfield; }
391
392protected:
393 lldb::TypeImplSP m_type_impl_sp;
394 uint64_t m_bit_offset = 0;
396 uint32_t m_bitfield_bit_size = 0; // Bit size for bitfield members only
397 bool m_is_bitfield = false;
398};
399
400///
401/// Sometimes you can find the name of the type corresponding to an object, but
402/// we don't have debug
403/// information for it. If that is the case, you can return one of these
404/// objects, and then if it
405/// has a full type, you can use that, but if not at least you can print the
406/// name for informational
407/// purposes.
408///
409
411public:
412 TypeAndOrName() = default;
413 TypeAndOrName(lldb::TypeSP &type_sp);
414 TypeAndOrName(const CompilerType &compiler_type);
415 TypeAndOrName(const char *type_str);
416 TypeAndOrName(ConstString &type_const_string);
417
418 bool operator==(const TypeAndOrName &other) const;
419
420 bool operator!=(const TypeAndOrName &other) const;
421
422 ConstString GetName() const;
423
425
426 void SetName(ConstString type_name);
427
428 void SetName(const char *type_name_cstr);
429
430 void SetTypeSP(lldb::TypeSP type_sp);
431
432 void SetCompilerType(CompilerType compiler_type);
433
434 bool IsEmpty() const;
435
436 bool HasName() const;
437
438 bool HasCompilerType() const;
439
440 bool HasType() const { return HasCompilerType(); }
441
442 void Clear();
443
444 explicit operator bool() { return !IsEmpty(); }
445
446private:
449};
450
452public:
454
456 const std::string &name,
457 const lldb::MemberFunctionKind &kind)
458 : m_type(type), m_decl(decl), m_name(name), m_kind(kind) {}
459
460 bool IsValid();
461
462 ConstString GetName() const;
463
465
466 CompilerType GetType() const;
467
469
470 size_t GetNumArguments() const;
471
472 CompilerType GetArgumentAtIndex(size_t idx) const;
473
475
476 bool GetDescription(Stream &stream);
477
478protected:
479 std::string GetPrintableTypeName();
480
481private:
486};
487
489public:
490 TypeEnumMemberImpl() : m_name("<invalid>") {}
491
492 TypeEnumMemberImpl(const lldb::TypeImplSP &integer_type_sp, ConstString name,
493 const llvm::APSInt &value);
494
496
498
499 bool IsValid() { return m_valid; }
500
501 ConstString GetName() const { return m_name; }
502
503 const lldb::TypeImplSP &GetIntegerType() const { return m_integer_type_sp; }
504
505 uint64_t GetValueAsUnsigned() const { return m_value.getZExtValue(); }
506
507 int64_t GetValueAsSigned() const { return m_value.getSExtValue(); }
508
509protected:
510 lldb::TypeImplSP m_integer_type_sp;
512 llvm::APSInt m_value;
513 bool m_valid = false;
514};
515
517public:
519
520 void Append(const lldb::TypeEnumMemberImplSP &type) {
521 m_content.push_back(type);
522 }
523
525
526 lldb::TypeEnumMemberImplSP GetTypeEnumMemberAtIndex(size_t idx) {
527 lldb::TypeEnumMemberImplSP enum_member;
528 if (idx < GetSize())
529 enum_member = m_content[idx];
530 return enum_member;
531 }
532
533 size_t GetSize() { return m_content.size(); }
534
535private:
536 std::vector<lldb::TypeEnumMemberImplSP> m_content;
537};
538
539} // namespace lldb_private
540
541#endif // LLDB_SYMBOL_TYPE_H
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
This is a minimal wrapper of a TypeSystem shared pointer as returned by CompilerType which conventien...
Definition: CompilerType.h:52
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:39
An data extractor class.
Definition: DataExtractor.h:48
A class that describes the declaration location of a lldb object.
Definition: Declaration.h:24
"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
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:436
SymbolFile & m_symbol_file
Definition: Type.h:64
SymbolFileType(SymbolFile &symbol_file, lldb::user_id_t uid)
Definition: Type.h:51
SymbolFile & GetSymbolFile() const
Definition: Type.h:61
lldb::TypeSP m_type_sp
Definition: Type.h:65
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:47
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:410
void SetName(ConstString type_name)
Definition: Type.cpp:784
TypeAndOrName(const CompilerType &compiler_type)
bool operator!=(const TypeAndOrName &other) const
Definition: Type.cpp:772
bool operator==(const TypeAndOrName &other) const
Definition: Type.cpp:764
CompilerType GetCompilerType() const
Definition: Type.h:424
bool HasName() const
Definition: Type.cpp:815
ConstString GetName() const
Definition: Type.cpp:776
bool HasCompilerType() const
Definition: Type.cpp:817
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:800
ConstString m_type_name
Definition: Type.h:448
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:792
bool HasType() const
Definition: Type.h:440
CompilerType m_compiler_type
Definition: Type.h:447
bool IsEmpty() const
Definition: Type.cpp:806
TypeAndOrName(lldb::TypeSP &type_sp)
int64_t GetValueAsSigned() const
Definition: Type.h:507
ConstString GetName() const
Definition: Type.h:501
const lldb::TypeImplSP & GetIntegerType() const
Definition: Type.h:503
TypeEnumMemberImpl(const TypeEnumMemberImpl &rhs)=default
TypeEnumMemberImpl & operator=(const TypeEnumMemberImpl &rhs)
lldb::TypeImplSP m_integer_type_sp
Definition: Type.h:510
uint64_t GetValueAsUnsigned() const
Definition: Type.h:505
lldb::TypeEnumMemberImplSP GetTypeEnumMemberAtIndex(size_t idx)
Definition: Type.h:526
std::vector< lldb::TypeEnumMemberImplSP > m_content
Definition: Type.h:536
void Append(const lldb_private::TypeEnumMemberListImpl &type_list)
void Append(const lldb::TypeEnumMemberImplSP &type)
Definition: Type.h:520
CompilerType GetCompilerType(bool prefer_dynamic)
Definition: Type.cpp:1044
bool operator!=(const TypeImpl &rhs) const
Definition: Type.cpp:913
bool CheckExeModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:875
bool GetDescription(lldb_private::Stream &strm, lldb::DescriptionLevel description_level)
Definition: Type.cpp:1068
bool operator==(const TypeImpl &rhs) const
Definition: Type.cpp:908
bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp, lldb::ModuleSP &module_sp) const
Definition: Type.cpp:879
TypeImpl GetCanonicalType() const
Definition: Type.cpp:1032
void SetType(const lldb::TypeSP &type_sp)
Definition: Type.cpp:842
TypeImpl GetUnqualifiedType() const
Definition: Type.cpp:1020
TypeImpl GetPointeeType() const
Definition: Type.cpp:972
CompilerType m_dynamic_type
Definition: Type.h:325
CompilerType::TypeSystemSPWrapper GetTypeSystem(bool prefer_dynamic)
Definition: Type.cpp:1056
CompilerType m_static_type
Definition: Type.h:324
bool CheckModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:871
lldb::ModuleSP GetModule() const
Definition: Type.cpp:933
TypeImpl GetDereferencedType() const
Definition: Type.cpp:1008
bool IsValid() const
Definition: Type.cpp:917
TypeImpl GetPointerType() const
Definition: Type.cpp:960
lldb::ModuleWP m_exe_module_wp
Definition: Type.h:323
TypeImpl GetReferenceType() const
Definition: Type.cpp:984
TypeImpl GetTypedefedType() const
Definition: Type.cpp:996
lldb::ModuleWP m_module_wp
Definition: Type.h:322
ConstString GetName() const
Definition: Type.cpp:940
ConstString GetDisplayTypeName() const
Definition: Type.cpp:950
void operator()(const lldb::TypeImplSP &type)
Definition: Type.h:338
AppendVisitor(TypeListImpl &type_list)
Definition: Type.h:336
lldb::TypeImplSP GetTypeAtIndex(size_t idx)
Definition: Type.h:346
void Append(const lldb::TypeImplSP &type)
Definition: Type.h:332
std::vector< lldb::TypeImplSP > m_content
Definition: Type.h:356
CompilerType GetReturnType() const
Definition: Type.cpp:1124
ConstString GetMangledName() const
Definition: Type.cpp:1090
CompilerType GetType() const
Definition: Type.cpp:1094
ConstString GetName() const
Definition: Type.cpp:1088
TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl, const std::string &name, const lldb::MemberFunctionKind &kind)
Definition: Type.h:455
CompilerType GetArgumentAtIndex(size_t idx) const
Definition: Type.cpp:1137
bool GetDescription(Stream &stream)
Definition: Type.cpp:1100
lldb::MemberFunctionKind GetKind() const
Definition: Type.cpp:1096
lldb::MemberFunctionKind m_kind
Definition: Type.h:485
bool GetIsBitfield() const
Definition: Type.h:388
uint32_t GetBitfieldBitSize() const
Definition: Type.h:382
void SetIsBitfield(bool is_bitfield)
Definition: Type.h:390
const lldb::TypeImplSP & GetTypeImpl()
Definition: Type.h:376
ConstString GetName() const
Definition: Type.h:378
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset, ConstString name, uint32_t bitfield_bit_size=0, bool is_bitfield=false)
Definition: Type.h:363
uint32_t m_bitfield_bit_size
Definition: Type.h:396
uint64_t GetBitOffset() const
Definition: Type.h:380
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
Definition: Type.h:369
lldb::TypeImplSP m_type_impl_sp
Definition: Type.h:393
void SetBitfieldBitSize(uint32_t bitfield_bit_size)
Definition: Type.h:384
Type * m_encoding_type
Definition: Type.h:214
void SetEncodingType(Type *encoding_type)
Definition: Type.h:199
CompilerType m_compiler_type
Definition: Type.h:220
CompilerType GetForwardCompilerType()
Definition: Type.cpp:667
lldb::Format GetFormat()
Definition: Type.cpp:412
Declaration m_decl
Definition: Type.h:219
Type & operator=(const Type &t)=default
Type * GetEncodingType()
Definition: Type.cpp:339
ConstString GetName()
Definition: Type.cpp:303
const SymbolContextScope * GetSymbolContextScope() const
Definition: Type.h:171
void SetSymbolContextScope(SymbolContextScope *context)
Definition: Type.h:172
static bool GetTypeScopeAndBasename(llvm::StringRef name, llvm::StringRef &scope, llvm::StringRef &basename, lldb::TypeClass &type_class)
Definition: Type.cpp:676
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:480
uint64_t m_byte_size_has_value
Definition: Type.h:218
bool IsTemplateType()
Definition: Type.cpp:398
void DumpValue(ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, uint32_t data_offset, bool show_type, bool show_summary, bool verbose, lldb::Format format=lldb::eFormatDefault)
Definition: Type.cpp:315
ResolveState m_compiler_type_resolve_state
Definition: Type.h:221
ConstString m_name
Definition: Type.h:210
static int Compare(const Type &a, const Type &b)
uint32_t GetEncodingMask()
Definition: Type.cpp:648
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:172
Type & operator=(Type &&t)=default
uint32_t GetNumChildren(bool omit_empty_base_classes)
Definition: Type.cpp:390
const SymbolFile * GetSymbolFile() const
Definition: Type.h:126
SymbolContextScope * m_context
The symbol context in which this type is defined.
Definition: Type.h:213
bool IsValidType()
Definition: Type.h:141
lldb::user_id_t m_encoding_uid
Definition: Type.h:215
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
Definition: Type.h:80
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
Definition: Type.h:77
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
Definition: Type.h:83
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
Definition: Type.h:93
@ eEncodingIsSyntheticUID
This type is the synthetic type whose UID is m_encoding_uid.
Definition: Type.h:95
@ eEncodingInvalid
Invalid encoding.
Definition: Type.h:72
@ eEncodingIsTypedefUID
This type is alias to a type whose UID is m_encoding_uid.
Definition: Type.h:85
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:87
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:89
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:91
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
Definition: Type.h:74
Payload m_payload
Language-specific flags.
Definition: Type.h:223
SymbolFile * GetSymbolFile()
Definition: Type.h:125
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:237
Payload GetPayload()
Return the language-specific payload.
Definition: Type.h:205
CompilerType GetLayoutCompilerType()
Definition: Type.cpp:662
void SetPayload(Payload opaque_payload)
Return the language-specific payload.
Definition: Type.h:207
lldb::Encoding GetEncoding(uint64_t &count)
Definition: Type.cpp:414
Type(Type &&t)=default
lldb::ModuleSP GetExeModule()
GetModule may return module for compile unit's object file.
Definition: Type.cpp:739
void DumpTypeName(Stream *s)
Definition: Type.cpp:313
SymbolContextScope * GetSymbolContextScope()
Definition: Type.h:170
lldb::TypeSP GetTypedefType()
Definition: Type.cpp:402
bool ResolveCompilerType(ResolveState compiler_type_resolve_state)
Definition: Type.cpp:482
SymbolFile * m_symbol_file
Definition: Type.h:211
ConstString GetName() const
Definition: Type.h:147
Type(Type &t)=default
bool IsAggregateType()
Definition: Type.cpp:394
EncodingDataType m_encoding_uid_type
Definition: Type.h:216
uint64_t m_byte_size
Definition: Type.h:217
uint32_t Payload
Definition: Type.h:203
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
Definition: Type.cpp:345
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:437
bool DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s, lldb::addr_t address, AddressType address_type, bool show_types, bool show_summary, bool verbose)
Definition: Type.cpp:419
ConstString GetBaseName()
Definition: Type.cpp:309
ConstString GetQualifiedName()
Definition: Type.cpp:672
CompilerType GetFullCompilerType()
Definition: Type.cpp:657
lldb::ModuleSP GetModule()
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sur...
Definition: Type.cpp:733
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:475
bool IsTypedef()
Definition: Type.h:143
#define LLDB_INVALID_UID
Definition: lldb-defines.h:80
A class that represents a running process on the host machine.
bool contextMatches(llvm::ArrayRef< CompilerContext > context_chain, llvm::ArrayRef< CompilerContext > pattern)
Match context_chain against pattern, which may contain "Any" kinds.
Definition: Type.cpp:38
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelFull
Format
Display format definitions.
Encoding
Register encoding definitions.
MemberFunctionKind
Kind of member function.
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
uint64_t user_id_t
Definition: lldb-types.h:84
uint64_t addr_t
Definition: lldb-types.h:83
CompilerContext allows an array of these items to be passed to perform detailed lookups in SymbolVend...
Definition: Type.h:29
CompilerContextKind kind
Definition: Type.h:39
bool operator==(const CompilerContext &rhs) const
Definition: Type.h:32
bool operator!=(const CompilerContext &rhs) const
Definition: Type.h:35
CompilerContext(CompilerContextKind t, ConstString n)
Definition: Type.h:30
A mix in class that contains a generic user ID.
Definition: UserID.h:31