LLDB mainline
Type.cpp
Go to the documentation of this file.
1//===-- Type.cpp ----------------------------------------------------------===//
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#include <cstdio>
10#include <optional>
11
12#include "lldb/Core/Module.h"
16#include "lldb/Utility/Log.h"
17#include "lldb/Utility/Scalar.h"
19
25#include "lldb/Symbol/Type.h"
28
30#include "lldb/Target/Process.h"
31#include "lldb/Target/Target.h"
33
34#include "llvm/ADT/StringRef.h"
35
36using namespace lldb;
37using namespace lldb_private;
38
39bool lldb_private::contextMatches(llvm::ArrayRef<CompilerContext> context_chain,
40 llvm::ArrayRef<CompilerContext> pattern) {
41 auto ctx = context_chain.begin();
42 auto ctx_end = context_chain.end();
43 for (const CompilerContext &pat : pattern) {
44 // Early exit if the pattern is too long.
45 if (ctx == ctx_end)
46 return false;
47 if (*ctx != pat) {
48 // Skip any number of module matches.
49 if (pat.kind == CompilerContextKind::AnyModule) {
50 // Greedily match 0..n modules.
51 ctx = std::find_if(ctx, ctx_end, [](const CompilerContext &ctx) {
52 return ctx.kind != CompilerContextKind::Module;
53 });
54 continue;
55 }
56 // See if there is a kind mismatch; they should have 1 bit in common.
57 if (((uint16_t)ctx->kind & (uint16_t)pat.kind) == 0)
58 return false;
59 // The name is ignored for AnyModule, but not for AnyType.
60 if (pat.kind != CompilerContextKind::AnyModule && ctx->name != pat.name)
61 return false;
62 }
63 ++ctx;
64 }
65 return true;
66}
67
68static CompilerContextKind ConvertTypeClass(lldb::TypeClass type_class) {
69 if (type_class == eTypeClassAny)
70 return CompilerContextKind::AnyType;
71 uint16_t result = 0;
72 if (type_class & lldb::eTypeClassClass)
73 result |= (uint16_t)CompilerContextKind::Class;
74 if (type_class & lldb::eTypeClassStruct)
75 result |= (uint16_t)CompilerContextKind::Struct;
76 if (type_class & lldb::eTypeClassUnion)
77 result |= (uint16_t)CompilerContextKind::Union;
78 if (type_class & lldb::eTypeClassEnumeration)
79 result |= (uint16_t)CompilerContextKind::Enum;
80 if (type_class & lldb::eTypeClassFunction)
81 result |= (uint16_t)CompilerContextKind::Function;
82 if (type_class & lldb::eTypeClassTypedef)
83 result |= (uint16_t)CompilerContextKind::Typedef;
84 return (CompilerContextKind)result;
85}
86
87TypeQuery::TypeQuery(llvm::StringRef name, TypeQueryOptions options)
88 : m_options(options) {
89 if (std::optional<Type::ParsedName> parsed_name =
91 llvm::ArrayRef scope = parsed_name->scope;
92 if (!scope.empty()) {
93 if (scope[0] == "::") {
94 m_options |= e_exact_match;
95 scope = scope.drop_front();
96 }
97 for (llvm::StringRef s : scope) {
98 m_context.push_back(
100 }
101 }
102 m_context.push_back({ConvertTypeClass(parsed_name->type_class),
103 ConstString(parsed_name->basename)});
104 } else {
106 }
107}
108
110 ConstString type_basename, TypeQueryOptions options)
111 : m_options(options) {
112 // Always use an exact match if we are looking for a type in compiler context.
113 m_options |= e_exact_match;
114 m_context = decl_ctx.GetCompilerContext();
115 m_context.push_back({CompilerContextKind::AnyType, type_basename});
116}
117
119 const llvm::ArrayRef<lldb_private::CompilerContext> &context,
120 TypeQueryOptions options)
121 : m_context(context), m_options(options) {
122 // Always use an exact match if we are looking for a type in compiler context.
123 m_options |= e_exact_match;
124}
125
126TypeQuery::TypeQuery(const CompilerDecl &decl, TypeQueryOptions options)
127 : m_options(options) {
128 // Always for an exact match if we are looking for a type using a declaration.
129 m_options |= e_exact_match;
131}
132
134 if (m_context.empty())
135 return ConstString();
136 return m_context.back().name;
137}
138
140 if (!m_languages)
142 m_languages->Insert(language);
143}
144
146 m_languages = std::move(languages);
147}
148
150 llvm::ArrayRef<CompilerContext> context_chain) const {
151 if (GetExactMatch() || context_chain.size() == m_context.size())
152 return ::contextMatches(context_chain, m_context);
153
154 // We don't have an exact match, we need to bottom m_context.size() items to
155 // match for a successful lookup.
156 if (context_chain.size() < m_context.size())
157 return false; // Not enough items in context_chain to allow for a match.
158
159 size_t compare_count = context_chain.size() - m_context.size();
160 return ::contextMatches(
161 llvm::ArrayRef<CompilerContext>(context_chain.data() + compare_count,
162 m_context.size()),
163 m_context);
164}
165
167 // If we have no language filterm language always matches.
168 if (!m_languages.has_value())
169 return true;
170 return (*m_languages)[language];
171}
172
174 return !m_searched_symbol_files.insert(sym_file).second;
175}
176
178 if (type_sp)
179 return m_type_map.InsertUnique(type_sp);
180 return false;
181}
182
183bool TypeResults::Done(const TypeQuery &query) const {
184 if (query.GetFindOne())
185 return !m_type_map.Empty();
186 return false;
187}
188
190 switch (kind) {
191 default:
192 s << "Invalid";
193 break;
195 s << "TranslationUnit";
196 break;
198 s << "Module";
199 break;
201 s << "Namespace";
202 break;
204 s << "Class";
205 break;
207 s << "Structure";
208 break;
210 s << "Union";
211 break;
213 s << "Function";
214 break;
216 s << "Variable";
217 break;
219 s << "Enumeration";
220 break;
222 s << "Typedef";
223 break;
225 s << "AnyModule";
226 break;
228 s << "AnyType";
229 break;
230 }
231 s << "(" << name << ")";
232}
233
235public:
236 TypeAppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
237
238 bool operator()(const lldb::TypeSP &type) {
239 m_type_list.Append(TypeImplSP(new TypeImpl(type)));
240 return true;
241 }
242
243private:
245};
246
248 TypeAppendVisitor cb(*this);
249 type_list.ForEach(cb);
250}
251
253 const lldb::TypeSP &type_sp)
254 : UserID(type_sp ? type_sp->GetID() : LLDB_INVALID_UID),
255 m_symbol_file(symbol_file), m_type_sp(type_sp) {}
256
258 if (!m_type_sp) {
259 Type *resolved_type = m_symbol_file.ResolveTypeUID(GetID());
260 if (resolved_type)
261 m_type_sp = resolved_type->shared_from_this();
262 }
263 return m_type_sp.get();
264}
265
267 std::optional<uint64_t> byte_size, SymbolContextScope *context,
268 user_id_t encoding_uid, EncodingDataType encoding_uid_type,
269 const Declaration &decl, const CompilerType &compiler_type,
270 ResolveState compiler_type_resolve_state, uint32_t opaque_payload)
271 : std::enable_shared_from_this<Type>(), UserID(uid), m_name(name),
272 m_symbol_file(symbol_file), m_context(context),
273 m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type),
274 m_decl(decl), m_compiler_type(compiler_type),
275 m_compiler_type_resolve_state(compiler_type ? compiler_type_resolve_state
276 : ResolveState::Unresolved),
277 m_payload(opaque_payload) {
278 if (byte_size) {
279 m_byte_size = *byte_size;
281 } else {
282 m_byte_size = 0;
283 m_byte_size_has_value = false;
284 }
285}
286
288 : std::enable_shared_from_this<Type>(), UserID(0), m_name("<INVALID TYPE>"),
289 m_payload(0) {
290 m_byte_size = 0;
291 m_byte_size_has_value = false;
292}
293
295 bool show_name, ExecutionContextScope *exe_scope) {
296 *s << "id = " << (const UserID &)*this;
297
298 // Call the name accessor to make sure we resolve the type name
299 if (show_name) {
300 ConstString type_name = GetName();
301 if (type_name) {
302 *s << ", name = \"" << type_name << '"';
303 ConstString qualified_type_name(GetQualifiedName());
304 if (qualified_type_name != type_name) {
305 *s << ", qualified = \"" << qualified_type_name << '"';
306 }
307 }
308 }
309
310 // Call the get byte size accessor so we resolve our byte size
311 if (GetByteSize(exe_scope))
312 s->Printf(", byte-size = %" PRIu64, m_byte_size);
313 bool show_fullpaths = (level == lldb::eDescriptionLevelVerbose);
314 m_decl.Dump(s, show_fullpaths);
315
316 if (m_compiler_type.IsValid()) {
317 *s << ", compiler_type = \"";
319 *s << '"';
320 } else if (m_encoding_uid != LLDB_INVALID_UID) {
321 s->Printf(", type_uid = 0x%8.8" PRIx64, m_encoding_uid);
322 switch (m_encoding_uid_type) {
323 case eEncodingInvalid:
324 break;
325 case eEncodingIsUID:
326 s->PutCString(" (unresolved type)");
327 break;
329 s->PutCString(" (unresolved const type)");
330 break;
332 s->PutCString(" (unresolved restrict type)");
333 break;
335 s->PutCString(" (unresolved volatile type)");
336 break;
338 s->PutCString(" (unresolved atomic type)");
339 break;
341 s->PutCString(" (unresolved typedef)");
342 break;
344 s->PutCString(" (unresolved pointer)");
345 break;
347 s->PutCString(" (unresolved L value reference)");
348 break;
350 s->PutCString(" (unresolved R value reference)");
351 break;
353 s->PutCString(" (synthetic type)");
354 break;
356 s->PutCString(" (ptrauth type)");
357 break;
358 }
359 }
360}
361
362void Type::Dump(Stream *s, bool show_context, lldb::DescriptionLevel level) {
363 s->Printf("%p: ", static_cast<void *>(this));
364 s->Indent();
365 *s << "Type" << static_cast<const UserID &>(*this) << ' ';
366 if (m_name)
367 *s << ", name = \"" << m_name << "\"";
368
370 s->Printf(", size = %" PRIu64, m_byte_size);
371
372 if (show_context && m_context != nullptr) {
373 s->PutCString(", context = ( ");
375 s->PutCString(" )");
376 }
377
378 bool show_fullpaths = false;
379 m_decl.Dump(s, show_fullpaths);
380
381 if (m_compiler_type.IsValid()) {
382 *s << ", compiler_type = " << m_compiler_type.GetOpaqueQualType() << ' ';
384 } else if (m_encoding_uid != LLDB_INVALID_UID) {
385 s->Format(", type_data = {0:x-16}", m_encoding_uid);
386 switch (m_encoding_uid_type) {
387 case eEncodingInvalid:
388 break;
389 case eEncodingIsUID:
390 s->PutCString(" (unresolved type)");
391 break;
393 s->PutCString(" (unresolved const type)");
394 break;
396 s->PutCString(" (unresolved restrict type)");
397 break;
399 s->PutCString(" (unresolved volatile type)");
400 break;
402 s->PutCString(" (unresolved atomic type)");
403 break;
405 s->PutCString(" (unresolved typedef)");
406 break;
408 s->PutCString(" (unresolved pointer)");
409 break;
411 s->PutCString(" (unresolved L value reference)");
412 break;
414 s->PutCString(" (unresolved R value reference)");
415 break;
417 s->PutCString(" (synthetic type)");
418 break;
420 s->PutCString(" (ptrauth type)");
421 }
422 }
423
424 //
425 // if (m_access)
426 // s->Printf(", access = %u", m_access);
427 s->EOL();
428}
429
431 if (!m_name)
433 return m_name;
434}
435
437 return GetForwardCompilerType().GetTypeName(/*BaseOnly*/ true);
438}
439
440void Type::DumpTypeName(Stream *s) { GetName().Dump(s, "<invalid-type-name>"); }
441
445 return m_encoding_type;
446}
447
448std::optional<uint64_t> Type::GetByteSize(ExecutionContextScope *exe_scope) {
450 return static_cast<uint64_t>(m_byte_size);
451
452 switch (m_encoding_uid_type) {
453 case eEncodingInvalid:
455 break;
456 case eEncodingIsUID:
462 Type *encoding_type = GetEncodingType();
463 if (encoding_type)
464 if (std::optional<uint64_t> size =
465 encoding_type->GetByteSize(exe_scope)) {
466 m_byte_size = *size;
468 return static_cast<uint64_t>(m_byte_size);
469 }
470
471 if (std::optional<uint64_t> size =
472 GetLayoutCompilerType().GetByteSize(exe_scope)) {
473 m_byte_size = *size;
475 return static_cast<uint64_t>(m_byte_size);
476 }
477 } break;
478
479 // If we are a pointer or reference, then this is just a pointer size;
485 m_byte_size = arch.GetAddressByteSize();
487 return static_cast<uint64_t>(m_byte_size);
488 }
489 } break;
490 }
491 return {};
492}
493
494llvm::Expected<uint32_t> Type::GetNumChildren(bool omit_empty_base_classes) {
495 return GetForwardCompilerType().GetNumChildren(omit_empty_base_classes, nullptr);
496}
497
500}
501
504}
505
507 lldb::TypeSP type_sp;
508 if (IsTypedef()) {
510 if (typedef_type)
511 type_sp = typedef_type->shared_from_this();
512 }
513 return type_sp;
514}
515
517
519 // Make sure we resolve our type if it already hasn't been.
520 return GetForwardCompilerType().GetEncoding(count);
521}
522
524 AddressType address_type, DataExtractor &data) {
525 if (address_type == eAddressTypeFile) {
526 // Can't convert a file address to anything valid without more context
527 // (which Module it came from)
528 return false;
529 }
530
531 const uint64_t byte_size =
532 GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr)
533 .value_or(0);
534 if (data.GetByteSize() < byte_size) {
535 lldb::DataBufferSP data_sp(new DataBufferHeap(byte_size, '\0'));
536 data.SetData(data_sp);
537 }
538
539 uint8_t *dst = const_cast<uint8_t *>(data.PeekData(0, byte_size));
540 if (dst != nullptr) {
541 if (address_type == eAddressTypeHost) {
542 // The address is an address in this process, so just copy it
543 if (addr == 0)
544 return false;
545 memcpy(dst, reinterpret_cast<uint8_t *>(addr), byte_size);
546 return true;
547 } else {
548 if (exe_ctx) {
549 Process *process = exe_ctx->GetProcessPtr();
550 if (process) {
552 return exe_ctx->GetProcessPtr()->ReadMemory(addr, dst, byte_size,
553 error) == byte_size;
554 }
555 }
556 }
557 }
558 return false;
559}
560
562 AddressType address_type, DataExtractor &data) {
563 return false;
564}
565
566const Declaration &Type::GetDeclaration() const { return m_decl; }
567
568bool Type::ResolveCompilerType(ResolveState compiler_type_resolve_state) {
569 // TODO: This needs to consider the correct type system to use.
570 Type *encoding_type = nullptr;
571 if (!m_compiler_type.IsValid()) {
572 encoding_type = GetEncodingType();
573 if (encoding_type) {
574 switch (m_encoding_uid_type) {
575 case eEncodingIsUID: {
576 CompilerType encoding_compiler_type =
577 encoding_type->GetForwardCompilerType();
578 if (encoding_compiler_type.IsValid()) {
579 m_compiler_type = encoding_compiler_type;
581 encoding_type->m_compiler_type_resolve_state;
582 }
583 } break;
584
587 encoding_type->GetForwardCompilerType().AddConstModifier();
588 break;
589
593 break;
594
598 break;
599
602 encoding_type->GetForwardCompilerType().GetAtomicType();
603 break;
604
607 m_name.AsCString("__lldb_invalid_typedef_name"),
608 GetSymbolFile()->GetDeclContextContainingUID(GetID()), m_payload);
609 m_name.Clear();
610 break;
611
614 encoding_type->GetForwardCompilerType().GetPointerType();
615 break;
616
620 break;
621
625 break;
626
630 m_payload);
631 break;
632
633 default:
634 llvm_unreachable("Unhandled encoding_data_type.");
635 }
636 } else {
637 // We have no encoding type, return void?
638 auto type_system_or_err =
640 if (auto err = type_system_or_err.takeError()) {
642 GetLog(LLDBLog::Symbols), std::move(err),
643 "Unable to construct void type from TypeSystemClang: {0}");
644 } else {
645 CompilerType void_compiler_type;
646 auto ts = *type_system_or_err;
647 if (ts)
648 void_compiler_type = ts->GetBasicTypeFromAST(eBasicTypeVoid);
649 switch (m_encoding_uid_type) {
650 case eEncodingIsUID:
651 m_compiler_type = void_compiler_type;
652 break;
653
655 m_compiler_type = void_compiler_type.AddConstModifier();
656 break;
657
659 m_compiler_type = void_compiler_type.AddRestrictModifier();
660 break;
661
663 m_compiler_type = void_compiler_type.AddVolatileModifier();
664 break;
665
667 m_compiler_type = void_compiler_type.GetAtomicType();
668 break;
669
671 m_compiler_type = void_compiler_type.CreateTypedef(
672 m_name.AsCString("__lldb_invalid_typedef_name"),
673 GetSymbolFile()->GetDeclContextContainingUID(GetID()), m_payload);
674 break;
675
677 m_compiler_type = void_compiler_type.GetPointerType();
678 break;
679
681 m_compiler_type = void_compiler_type.GetLValueReferenceType();
682 break;
683
685 m_compiler_type = void_compiler_type.GetRValueReferenceType();
686 break;
687
689 llvm_unreachable("Cannot handle eEncodingIsLLVMPtrAuthUID without "
690 "valid encoding_type");
691
692 default:
693 llvm_unreachable("Unhandled encoding_data_type.");
694 }
695 }
696 }
697
698 // When we have a EncodingUID, our "m_flags.compiler_type_resolve_state" is
699 // set to eResolveStateUnresolved so we need to update it to say that we
700 // now have a forward declaration since that is what we created above.
703 }
704
705 // Check if we have a forward reference to a class/struct/union/enum?
706 if (compiler_type_resolve_state == ResolveState::Layout ||
707 compiler_type_resolve_state == ResolveState::Full) {
708 // Check if we have a forward reference to a class/struct/union/enum?
709 if (m_compiler_type.IsValid() &&
710 m_compiler_type_resolve_state < compiler_type_resolve_state) {
712 if (!m_compiler_type.IsDefined()) {
713 // We have a forward declaration, we need to resolve it to a complete
714 // definition.
716 }
717 }
718 }
719
720 // If we have an encoding type, then we need to make sure it is resolved
721 // appropriately.
723 if (encoding_type == nullptr)
724 encoding_type = GetEncodingType();
725 if (encoding_type) {
726 ResolveState encoding_compiler_type_resolve_state =
727 compiler_type_resolve_state;
728
729 if (compiler_type_resolve_state == ResolveState::Layout) {
730 switch (m_encoding_uid_type) {
734 encoding_compiler_type_resolve_state = ResolveState::Forward;
735 break;
736 default:
737 break;
738 }
739 }
740 encoding_type->ResolveCompilerType(encoding_compiler_type_resolve_state);
741 }
742 }
743 return m_compiler_type.IsValid();
744}
746 uint32_t encoding_mask = 1u << m_encoding_uid_type;
747 Type *encoding_type = GetEncodingType();
748 assert(encoding_type != this);
749 if (encoding_type)
750 encoding_mask |= encoding_type->GetEncodingMask();
751 return encoding_mask;
752}
753
756 return m_compiler_type;
757}
758
761 return m_compiler_type;
762}
763
766 return m_compiler_type;
767}
768
771}
772
773std::optional<Type::ParsedName>
774Type::GetTypeScopeAndBasename(llvm::StringRef name) {
775 ParsedName result;
776
777 if (name.empty())
778 return std::nullopt;
779
780 if (name.consume_front("struct "))
781 result.type_class = eTypeClassStruct;
782 else if (name.consume_front("class "))
783 result.type_class = eTypeClassClass;
784 else if (name.consume_front("union "))
785 result.type_class = eTypeClassUnion;
786 else if (name.consume_front("enum "))
787 result.type_class = eTypeClassEnumeration;
788 else if (name.consume_front("typedef "))
789 result.type_class = eTypeClassTypedef;
790
791 if (name.consume_front("::"))
792 result.scope.push_back("::");
793
794 bool prev_is_colon = false;
795 size_t template_depth = 0;
796 size_t name_begin = 0;
797 for (const auto &pos : llvm::enumerate(name)) {
798 switch (pos.value()) {
799 case ':':
800 if (prev_is_colon && template_depth == 0) {
801 result.scope.push_back(name.slice(name_begin, pos.index() - 1));
802 name_begin = pos.index() + 1;
803 }
804 break;
805 case '<':
806 ++template_depth;
807 break;
808 case '>':
809 if (template_depth == 0)
810 return std::nullopt; // Invalid name.
811 --template_depth;
812 break;
813 }
814 prev_is_colon = pos.value() == ':';
815 }
816
817 if (name_begin < name.size() && template_depth == 0)
818 result.basename = name.substr(name_begin);
819 else
820 return std::nullopt;
821
822 return result;
823}
824
826 if (m_symbol_file)
828 return ModuleSP();
829}
830
832 if (m_compiler_type) {
833 auto ts = m_compiler_type.GetTypeSystem();
834 if (!ts)
835 return {};
836 SymbolFile *symbol_file = ts->GetSymbolFile();
837 if (symbol_file)
838 return symbol_file->GetObjectFile()->GetModule();
839 }
840 return {};
841}
842
844 if (in_type_sp) {
845 m_compiler_type = in_type_sp->GetForwardCompilerType();
846 m_type_name = in_type_sp->GetName();
847 }
848}
849
850TypeAndOrName::TypeAndOrName(const char *in_type_str)
851 : m_type_name(in_type_str) {}
852
854 : m_type_name(in_type_const_string) {}
855
856bool TypeAndOrName::operator==(const TypeAndOrName &other) const {
857 if (m_compiler_type != other.m_compiler_type)
858 return false;
859 if (m_type_name != other.m_type_name)
860 return false;
861 return true;
862}
863
864bool TypeAndOrName::operator!=(const TypeAndOrName &other) const {
865 return !(*this == other);
866}
867
869 if (m_type_name)
870 return m_type_name;
871 if (m_compiler_type)
873 return ConstString("<invalid>");
874}
875
877 m_type_name = type_name;
878}
879
880void TypeAndOrName::SetName(const char *type_name_cstr) {
881 m_type_name.SetCString(type_name_cstr);
882}
883
884void TypeAndOrName::SetName(llvm::StringRef type_name) {
885 m_type_name.SetString(type_name);
886}
887
889 if (type_sp) {
890 m_compiler_type = type_sp->GetForwardCompilerType();
891 m_type_name = type_sp->GetName();
892 } else
893 Clear();
894}
895
897 m_compiler_type = compiler_type;
898 if (m_compiler_type)
900}
901
903 return !((bool)m_type_name || (bool)m_compiler_type);
904}
905
909}
910
911bool TypeAndOrName::HasName() const { return (bool)m_type_name; }
912
914 return m_compiler_type.IsValid();
915}
916
918 : m_module_wp(), m_static_type(), m_dynamic_type() {
919 SetType(type_sp);
920}
921
922TypeImpl::TypeImpl(const CompilerType &compiler_type)
923 : m_module_wp(), m_static_type(), m_dynamic_type() {
924 SetType(compiler_type);
925}
926
927TypeImpl::TypeImpl(const lldb::TypeSP &type_sp, const CompilerType &dynamic)
928 : m_module_wp(), m_static_type(), m_dynamic_type(dynamic) {
929 SetType(type_sp, dynamic);
930}
931
933 const CompilerType &dynamic_type)
934 : m_module_wp(), m_static_type(), m_dynamic_type() {
935 SetType(static_type, dynamic_type);
936}
937
938void TypeImpl::SetType(const lldb::TypeSP &type_sp) {
939 if (type_sp) {
940 m_static_type = type_sp->GetForwardCompilerType();
941 m_exe_module_wp = type_sp->GetExeModule();
942 m_module_wp = type_sp->GetModule();
943 } else {
946 }
947}
948
949void TypeImpl::SetType(const CompilerType &compiler_type) {
951 m_static_type = compiler_type;
952}
953
954void TypeImpl::SetType(const lldb::TypeSP &type_sp,
955 const CompilerType &dynamic) {
956 SetType(type_sp);
957 m_dynamic_type = dynamic;
958}
959
960void TypeImpl::SetType(const CompilerType &compiler_type,
961 const CompilerType &dynamic) {
963 m_static_type = compiler_type;
964 m_dynamic_type = dynamic;
965}
966
967bool TypeImpl::CheckModule(lldb::ModuleSP &module_sp) const {
968 return CheckModuleCommon(m_module_wp, module_sp);
969}
970
972 return CheckModuleCommon(m_exe_module_wp, module_sp);
973}
974
975bool TypeImpl::CheckModuleCommon(const lldb::ModuleWP &input_module_wp,
976 lldb::ModuleSP &module_sp) const {
977 // Check if we have a module for this type. If we do and the shared pointer
978 // is can be successfully initialized with m_module_wp, return true. Else
979 // return false if we didn't have a module, or if we had a module and it has
980 // been deleted. Any functions doing anything with a TypeSP in this TypeImpl
981 // class should call this function and only do anything with the ivars if
982 // this function returns true. If we have a module, the "module_sp" will be
983 // filled in with a strong reference to the module so that the module will at
984 // least stay around long enough for the type query to succeed.
985 module_sp = input_module_wp.lock();
986 if (!module_sp) {
987 lldb::ModuleWP empty_module_wp;
988 // If either call to "std::weak_ptr::owner_before(...) value returns true,
989 // this indicates that m_module_wp once contained (possibly still does) a
990 // reference to a valid shared pointer. This helps us know if we had a
991 // valid reference to a section which is now invalid because the module it
992 // was in was deleted
993 if (empty_module_wp.owner_before(input_module_wp) ||
994 input_module_wp.owner_before(empty_module_wp)) {
995 // input_module_wp had a valid reference to a module, but all strong
996 // references have been released and the module has been deleted
997 return false;
998 }
999 }
1000 // We either successfully locked the module, or didn't have one to begin with
1001 return true;
1002}
1003
1004bool TypeImpl::operator==(const TypeImpl &rhs) const {
1005 return m_static_type == rhs.m_static_type &&
1007}
1008
1009bool TypeImpl::operator!=(const TypeImpl &rhs) const {
1010 return !(*this == rhs);
1011}
1012
1013bool TypeImpl::IsValid() const {
1014 // just a name is not valid
1015 ModuleSP module_sp;
1016 if (CheckModule(module_sp))
1018 return false;
1019}
1020
1021TypeImpl::operator bool() const { return IsValid(); }
1022
1027}
1028
1030 lldb::ModuleSP module_sp;
1031 if (CheckExeModule(module_sp))
1032 return module_sp;
1033 return nullptr;
1034}
1035
1037 ModuleSP module_sp;
1038 if (CheckModule(module_sp)) {
1039 if (m_dynamic_type)
1040 return m_dynamic_type.GetTypeName();
1041 return m_static_type.GetTypeName();
1042 }
1043 return ConstString();
1044}
1045
1047 ModuleSP module_sp;
1048 if (CheckModule(module_sp)) {
1049 if (m_dynamic_type)
1052 }
1053 return ConstString();
1054}
1055
1057 ModuleSP module_sp;
1058 if (CheckModule(module_sp)) {
1059 if (m_dynamic_type.IsValid()) {
1062 }
1064 }
1065 return TypeImpl();
1066}
1067
1069 ModuleSP module_sp;
1070 if (CheckModule(module_sp)) {
1071 if (m_dynamic_type.IsValid()) {
1074 }
1076 }
1077 return TypeImpl();
1078}
1079
1081 ModuleSP module_sp;
1082 if (CheckModule(module_sp)) {
1083 if (m_dynamic_type.IsValid()) {
1086 }
1088 }
1089 return TypeImpl();
1090}
1091
1093 ModuleSP module_sp;
1094 if (CheckModule(module_sp)) {
1095 if (m_dynamic_type.IsValid()) {
1098 }
1100 }
1101 return TypeImpl();
1102}
1103
1105 ModuleSP module_sp;
1106 if (CheckModule(module_sp)) {
1107 if (m_dynamic_type.IsValid()) {
1110 }
1112 }
1113 return TypeImpl();
1114}
1115
1117 ModuleSP module_sp;
1118 if (CheckModule(module_sp)) {
1119 if (m_dynamic_type.IsValid()) {
1122 }
1124 }
1125 return TypeImpl();
1126}
1127
1129 ModuleSP module_sp;
1130 if (CheckModule(module_sp)) {
1131 if (m_dynamic_type.IsValid()) {
1134 }
1136 }
1137 return TypeImpl();
1138}
1139
1141 ModuleSP module_sp;
1142 if (CheckModule(module_sp)) {
1143 if (prefer_dynamic) {
1144 if (m_dynamic_type.IsValid())
1145 return m_dynamic_type;
1146 }
1147 return m_static_type;
1148 }
1149 return CompilerType();
1150}
1151
1153 ModuleSP module_sp;
1154 if (CheckModule(module_sp)) {
1155 if (prefer_dynamic) {
1156 if (m_dynamic_type.IsValid())
1158 }
1160 }
1161 return {};
1162}
1163
1165 lldb::DescriptionLevel description_level) {
1166 ModuleSP module_sp;
1167 if (CheckModule(module_sp)) {
1168 if (m_dynamic_type.IsValid()) {
1169 strm.Printf("Dynamic:\n");
1171 strm.Printf("\nStatic:\n");
1172 }
1174 } else {
1175 strm.PutCString("Invalid TypeImpl module for type has been deleted\n");
1176 }
1177 return true;
1178}
1179
1181 if (name.empty())
1182 return CompilerType();
1183 return GetCompilerType(/*prefer_dynamic=*/false)
1185}
1186
1189}
1190
1192
1194 return m_decl.GetMangledName();
1195}
1196
1198
1200 return m_kind;
1201}
1202
1204 switch (m_kind) {
1206 return false;
1208 stream.Printf("constructor for %s",
1209 m_type.GetTypeName().AsCString("<unknown>"));
1210 break;
1212 stream.Printf("destructor for %s",
1213 m_type.GetTypeName().AsCString("<unknown>"));
1214 break;
1216 stream.Printf("instance method %s of type %s", m_name.AsCString(),
1218 break;
1220 stream.Printf("static method %s of type %s", m_name.AsCString(),
1222 break;
1223 }
1224 return true;
1225}
1226
1228 if (m_type)
1231}
1232
1234 if (m_type)
1236 else
1238}
1239
1241 if (m_type)
1243 else
1244 return m_decl.GetFunctionArgumentType(idx);
1245}
1246
1248 ConstString name,
1249 const llvm::APSInt &value)
1250 : m_integer_type_sp(integer_type_sp), m_name(name), m_value(value),
1251 m_valid((bool)name && (bool)integer_type_sp)
1252
1253{}
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERROR(log, error,...)
Definition: Log.h:382
static CompilerContextKind ConvertTypeClass(lldb::TypeClass type_class)
Definition: Type.cpp:68
bool operator()(const lldb::TypeSP &type)
Definition: Type.cpp:238
TypeListImpl & m_type_list
Definition: Type.cpp:244
TypeAppendVisitor(TypeListImpl &type_list)
Definition: Type.cpp:236
An architecture specification class.
Definition: ArchSpec.h:31
Represents a generic declaration context in a program.
std::vector< lldb_private::CompilerContext > GetCompilerContext() const
Populate a valid compiler context from the current decl context.
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
ConstString GetMangledName() const
CompilerType GetFunctionArgumentType(size_t arg_idx) const
CompilerType GetFunctionReturnType() const
CompilerDeclContext GetDeclContext() const
size_t GetNumFunctionArguments() const
std::vector< lldb_private::CompilerContext > GetCompilerContext() const
Populate a valid compiler context from the current declaration.
This is a minimal wrapper of a TypeSystem shared pointer as returned by CompilerType which conventien...
Definition: CompilerType.h:49
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const
Create related types using the current type's AST.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
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
ConstString GetDisplayTypeName() 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...
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
lldb::opaque_compiler_type_t GetOpaqueQualType() const
Definition: CompilerType.h:287
CompilerType AddVolatileModifier() const
Return a new CompilerType adds a volatile modifier to this type if this type is valid and the type sy...
CompilerType AddRestrictModifier() const
Return a new CompilerType adds a restrict modifier to this type if this type is valid and the type sy...
CompilerType GetDirectNestedTypeWithName(llvm::StringRef name) const
CompilerType GetFunctionArgumentAtIndex(const size_t index) const
CompilerType GetLValueReferenceType() const
Return a new CompilerType that is a L value reference to this type if this type is valid and the type...
size_t GetNumberOfFunctionArguments() 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...
ConstString GetTypeName(bool BaseOnly=false) const
CompilerType GetTypedefedType() const
If the current object represents a typedef type, get the underlying type.
lldb::Format GetFormat() const
CompilerType GetFullyUnqualifiedType() const
CompilerType GetPointeeType() const
If this type is a pointer type, return the type that the pointer points to, else return an invalid ty...
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) 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
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.
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
void SetCString(const char *cstr)
Set the C string value.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:188
void Dump(Stream *s, const char *value_if_empty=nullptr) const
Dump the object description to a stream.
void SetString(llvm::StringRef s)
void Clear()
Clear this object's state.
Definition: ConstString.h:230
A subclass of DataBuffer that stores a data buffer on the heap.
An data extractor class.
Definition: DataExtractor.h:48
const uint8_t * PeekData(lldb::offset_t offset, lldb::offset_t length) const
Peek at a bytes at offset.
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order)
Set data with a buffer that is caller owned.
A class that describes the declaration location of a lldb object.
Definition: Declaration.h:24
void Dump(Stream *s, bool show_fullpaths) const
Dump a description of this object to a Stream.
Definition: Declaration.cpp:14
"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.
ExecutionContextScope * GetBestExecutionContextScope() const
Process * GetProcessPtr() const
Returns a pointer to the process object.
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:24
virtual ArchSpec GetArchitecture()=0
Get the ArchSpec for this object file.
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
Read of memory from a process.
Definition: Process.cpp:1939
An error handling class.
Definition: Status.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
void Format(const char *format, Args &&... args)
Definition: Stream.h:353
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:65
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:155
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
virtual void DumpSymbolContext(Stream *s)=0
Dump the object's symbol context to the stream s.
SymbolFile & m_symbol_file
Definition: Type.h:375
SymbolFileType(SymbolFile &symbol_file, lldb::user_id_t uid)
Definition: Type.h:362
lldb::TypeSP m_type_sp
Definition: Type.h:376
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
virtual bool CompleteType(CompilerType &compiler_type)=0
virtual Type * ResolveTypeUID(lldb::user_id_t type_uid)=0
virtual llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language)=0
virtual ObjectFile * GetObjectFile()=0
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:741
void SetName(ConstString type_name)
Definition: Type.cpp:876
bool operator!=(const TypeAndOrName &other) const
Definition: Type.cpp:864
bool operator==(const TypeAndOrName &other) const
Definition: Type.cpp:856
bool HasName() const
Definition: Type.cpp:911
ConstString GetName() const
Definition: Type.cpp:868
bool HasCompilerType() const
Definition: Type.cpp:913
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:896
ConstString m_type_name
Definition: Type.h:781
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:888
CompilerType m_compiler_type
Definition: Type.h:780
bool IsEmpty() const
Definition: Type.cpp:902
CompilerType GetCompilerType(bool prefer_dynamic)
Definition: Type.cpp:1140
bool operator!=(const TypeImpl &rhs) const
Definition: Type.cpp:1009
bool CheckExeModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:971
bool GetDescription(lldb_private::Stream &strm, lldb::DescriptionLevel description_level)
Definition: Type.cpp:1164
bool operator==(const TypeImpl &rhs) const
Definition: Type.cpp:1004
bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp, lldb::ModuleSP &module_sp) const
Definition: Type.cpp:975
TypeImpl GetCanonicalType() const
Definition: Type.cpp:1128
void SetType(const lldb::TypeSP &type_sp)
Definition: Type.cpp:938
TypeImpl GetUnqualifiedType() const
Definition: Type.cpp:1116
TypeImpl GetPointeeType() const
Definition: Type.cpp:1068
CompilerType m_dynamic_type
Definition: Type.h:656
CompilerType::TypeSystemSPWrapper GetTypeSystem(bool prefer_dynamic)
Definition: Type.cpp:1152
CompilerType m_static_type
Definition: Type.h:655
bool CheckModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:967
lldb::ModuleSP GetModule() const
Definition: Type.cpp:1029
TypeImpl GetDereferencedType() const
Definition: Type.cpp:1104
bool IsValid() const
Definition: Type.cpp:1013
TypeImpl GetPointerType() const
Definition: Type.cpp:1056
lldb::ModuleWP m_exe_module_wp
Definition: Type.h:654
TypeImpl GetReferenceType() const
Definition: Type.cpp:1080
TypeImpl GetTypedefedType() const
Definition: Type.cpp:1092
lldb::ModuleWP m_module_wp
Definition: Type.h:653
ConstString GetName() const
Definition: Type.cpp:1036
CompilerType FindDirectNestedType(llvm::StringRef name)
Definition: Type.cpp:1180
ConstString GetDisplayTypeName() const
Definition: Type.cpp:1046
void Append(const lldb::TypeImplSP &type)
Definition: Type.h:663
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeList.cpp:78
bool Empty() const
Definition: TypeMap.cpp:77
bool InsertUnique(const lldb::TypeSP &type)
Definition: TypeMap.cpp:34
CompilerType GetReturnType() const
Definition: Type.cpp:1227
ConstString GetMangledName() const
Definition: Type.cpp:1193
CompilerType GetType() const
Definition: Type.cpp:1197
ConstString GetName() const
Definition: Type.cpp:1191
CompilerType GetArgumentAtIndex(size_t idx) const
Definition: Type.cpp:1240
bool GetDescription(Stream &stream)
Definition: Type.cpp:1203
lldb::MemberFunctionKind GetKind() const
Definition: Type.cpp:1199
lldb::MemberFunctionKind m_kind
Definition: Type.h:818
A class that contains all state required for type lookups.
Definition: Type.h:98
std::vector< lldb_private::CompilerContext > m_context
A full or partial compiler context array where the parent declaration contexts appear at the top of t...
Definition: Type.h:292
void AddLanguage(lldb::LanguageType language)
Add a language family to the list of languages that should produce a match.
Definition: Type.cpp:139
TypeQueryOptions m_options
An options bitmask that contains enabled options for the type query.
Definition: Type.h:295
bool LanguageMatches(lldb::LanguageType language) const
Check if the language matches any languages that have been added to this match object.
Definition: Type.cpp:166
bool GetExactMatch() const
Definition: Type.h:264
void SetLanguages(LanguageSet languages)
Set the list of languages that should produce a match to only the ones specified in languages.
Definition: Type.cpp:145
std::optional< LanguageSet > m_languages
If this variable has a value, then the language family must match at least one of the specified langu...
Definition: Type.h:299
ConstString GetTypeBasename() const
Get the type basename to use when searching the type indexes in each SymbolFile object.
Definition: Type.cpp:133
bool ContextMatches(llvm::ArrayRef< lldb_private::CompilerContext > context) const
Check of a CompilerContext array from matching type from a symbol file matches the m_context.
Definition: Type.cpp:149
bool GetFindOne() const
Returns true if the type query is supposed to find only a single matching type.
Definition: Type.h:273
bool InsertUnique(const lldb::TypeSP &type_sp)
When types that match a TypeQuery are found, this API is used to insert the matching types.
Definition: Type.cpp:177
llvm::DenseSet< lldb_private::SymbolFile * > m_searched_symbol_files
This set is used to track and make sure we only perform lookups in a symbol file one time.
Definition: Type.h:356
bool Done(const TypeQuery &query) const
Check if the type matching has found all of the matches that it needs.
Definition: Type.cpp:183
bool AlreadySearched(lldb_private::SymbolFile *sym_file)
Check if a SymbolFile object has already been searched by this type match object.
Definition: Type.cpp:173
TypeMap m_type_map
Matching types get added to this map as type search continues.
Definition: Type.h:353
Type * m_encoding_type
Definition: Type.h:543
CompilerType m_compiler_type
Definition: Type.h:549
CompilerType GetForwardCompilerType()
Definition: Type.cpp:764
lldb::Format GetFormat()
Definition: Type.cpp:516
Declaration m_decl
Definition: Type.h:548
Type * GetEncodingType()
Definition: Type.cpp:442
ConstString GetName()
Definition: Type.cpp:430
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:566
uint64_t m_byte_size_has_value
Definition: Type.h:547
bool IsTemplateType()
Definition: Type.cpp:502
ResolveState m_compiler_type_resolve_state
Definition: Type.h:550
ConstString m_name
Definition: Type.h:539
uint32_t GetEncodingMask()
Definition: Type.cpp:745
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:294
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes)
Definition: Type.cpp:494
SymbolContextScope * m_context
The symbol context in which this type is defined.
Definition: Type.h:542
lldb::user_id_t m_encoding_uid
Definition: Type.h:544
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
Definition: Type.h:391
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
Definition: Type.h:388
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
Definition: Type.h:394
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
Definition: Type.h:404
@ eEncodingIsLLVMPtrAuthUID
This type is a signed pointer.
Definition: Type.h:408
@ eEncodingIsSyntheticUID
This type is the synthetic type whose UID is m_encoding_uid.
Definition: Type.h:406
@ eEncodingInvalid
Invalid encoding.
Definition: Type.h:383
@ eEncodingIsTypedefUID
This type is alias to a type whose UID is m_encoding_uid.
Definition: Type.h:396
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:398
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:400
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:402
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
Definition: Type.h:385
Payload m_payload
Language-specific flags.
Definition: Type.h:552
SymbolFile * GetSymbolFile()
Definition: Type.h:438
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:362
CompilerType GetLayoutCompilerType()
Definition: Type.cpp:759
lldb::Encoding GetEncoding(uint64_t &count)
Definition: Type.cpp:518
lldb::ModuleSP GetExeModule()
GetModule may return module for compile unit's object file.
Definition: Type.cpp:831
void DumpTypeName(Stream *s)
Definition: Type.cpp:440
static std::optional< ParsedName > GetTypeScopeAndBasename(llvm::StringRef name)
Definition: Type.cpp:774
lldb::TypeSP GetTypedefType()
Definition: Type.cpp:506
bool ResolveCompilerType(ResolveState compiler_type_resolve_state)
Definition: Type.cpp:568
SymbolFile * m_symbol_file
Definition: Type.h:540
bool IsAggregateType()
Definition: Type.cpp:498
EncodingDataType m_encoding_uid_type
Definition: Type.h:545
uint64_t m_byte_size
Definition: Type.h:546
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
Definition: Type.cpp:448
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:523
ConstString GetBaseName()
Definition: Type.cpp:436
ConstString GetQualifiedName()
Definition: Type.cpp:769
CompilerType GetFullCompilerType()
Definition: Type.cpp:754
lldb::ModuleSP GetModule()
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sur...
Definition: Type.cpp:825
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:561
bool IsTypedef()
Definition: Type.h:456
#define LLDB_INVALID_UID
Definition: lldb-defines.h:88
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:331
@ AnyModule
Match 0..n nested modules.
@ AnyDeclContext
Math any declaration context.
bool contextMatches(llvm::ArrayRef< CompilerContext > context_chain, llvm::ArrayRef< CompilerContext > pattern)
Match context_chain against pattern, which may contain "Any" kinds.
Definition: Type.cpp:39
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
@ eAddressTypeHost
Address is an address in the process that is running this code.
Definition: SBAddress.h:15
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
std::weak_ptr< lldb_private::Module > ModuleWP
Definition: lldb-forward.h:369
Format
Display format definitions.
LanguageType
Programming language type.
@ eLanguageTypeC
Non-standardized C, such as K&R.
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:452
Encoding
Register encoding definitions.
MemberFunctionKind
Kind of member function.
@ eMemberFunctionKindInstanceMethod
A function that applies to a specific instance.
@ eMemberFunctionKindConstructor
A function used to create instances.
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
@ eMemberFunctionKindDestructor
A function used to tear down existing instances.
@ eMemberFunctionKindStaticMethod
A function that applies to a type rather than any instance.
uint64_t user_id_t
Definition: lldb-types.h:82
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:331
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP
Definition: lldb-forward.h:455
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:368
CompilerContext allows an array of these items to be passed to perform detailed lookups in SymbolVend...
Definition: Type.h:52
void Dump(Stream &s) const
Definition: Type.cpp:189
CompilerContextKind kind
Definition: Type.h:62
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: Type.h:38
llvm::SmallVector< llvm::StringRef > scope
Definition: Type.h:505
lldb::TypeClass type_class
Definition: Type.h:501
llvm::StringRef basename
Definition: Type.h:507
A mix in class that contains a generic user ID.
Definition: UserID.h:31
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47