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
39llvm::raw_ostream &lldb_private::operator<<(llvm::raw_ostream &os,
40 const CompilerContext &rhs) {
41 StreamString lldb_stream;
42 rhs.Dump(lldb_stream);
43 return os << lldb_stream.GetString();
44}
45
46bool lldb_private::contextMatches(llvm::ArrayRef<CompilerContext> context_chain,
47 llvm::ArrayRef<CompilerContext> pattern) {
48 auto ctx = context_chain.begin();
49 auto ctx_end = context_chain.end();
50 for (const CompilerContext &pat : pattern) {
51 // Early exit if the pattern is too long.
52 if (ctx == ctx_end)
53 return false;
54 if (*ctx != pat) {
55 // Skip any number of module matches.
56 if (pat.kind == CompilerContextKind::AnyModule) {
57 // Greedily match 0..n modules.
58 ctx = std::find_if(ctx, ctx_end, [](const CompilerContext &ctx) {
59 return ctx.kind != CompilerContextKind::Module;
60 });
61 continue;
62 }
63 // See if there is a kind mismatch; they should have 1 bit in common.
64 if (((uint16_t)ctx->kind & (uint16_t)pat.kind) == 0)
65 return false;
66 // The name is ignored for AnyModule, but not for AnyType.
67 if (pat.kind != CompilerContextKind::AnyModule && ctx->name != pat.name)
68 return false;
69 }
70 ++ctx;
71 }
72 return true;
73}
74
75static CompilerContextKind ConvertTypeClass(lldb::TypeClass type_class) {
76 if (type_class == eTypeClassAny)
77 return CompilerContextKind::AnyType;
78 CompilerContextKind result = {};
79 if (type_class & (lldb::eTypeClassClass | lldb::eTypeClassStruct))
80 result |= CompilerContextKind::ClassOrStruct;
81 if (type_class & lldb::eTypeClassUnion)
82 result |= CompilerContextKind::Union;
83 if (type_class & lldb::eTypeClassEnumeration)
84 result |= CompilerContextKind::Enum;
85 if (type_class & lldb::eTypeClassFunction)
86 result |= CompilerContextKind::Function;
87 if (type_class & lldb::eTypeClassTypedef)
88 result |= CompilerContextKind::Typedef;
89 return result;
90}
91
92TypeQuery::TypeQuery(llvm::StringRef name, TypeQueryOptions options)
93 : m_options(options) {
94 if (std::optional<Type::ParsedName> parsed_name =
96 llvm::ArrayRef scope = parsed_name->scope;
97 if (!scope.empty()) {
98 if (scope[0] == "::") {
99 m_options |= e_exact_match;
100 scope = scope.drop_front();
101 }
102 for (llvm::StringRef s : scope) {
103 m_context.push_back(
105 }
106 }
107 m_context.push_back({ConvertTypeClass(parsed_name->type_class),
108 ConstString(parsed_name->basename)});
109 } else {
111 }
112}
113
115 ConstString type_basename, TypeQueryOptions options)
116 : m_options(options) {
117 // Always use an exact match if we are looking for a type in compiler context.
118 m_options |= e_exact_match;
119 m_context = decl_ctx.GetCompilerContext();
120 m_context.push_back({CompilerContextKind::AnyType, type_basename});
121}
122
124 const llvm::ArrayRef<lldb_private::CompilerContext> &context,
125 TypeQueryOptions options)
126 : m_context(context), m_options(options) {
127 // Always use an exact match if we are looking for a type in compiler context.
128 m_options |= e_exact_match;
129}
130
131TypeQuery::TypeQuery(const CompilerDecl &decl, TypeQueryOptions options)
132 : m_options(options) {
133 // Always for an exact match if we are looking for a type using a declaration.
134 m_options |= e_exact_match;
136}
137
139 if (m_context.empty())
140 return ConstString();
141 return m_context.back().name;
142}
143
145 if (!m_languages)
147 m_languages->Insert(language);
148}
149
151 m_languages = std::move(languages);
152}
153
155 llvm::ArrayRef<CompilerContext> context_chain) const {
156 if (GetExactMatch() || context_chain.size() == m_context.size())
157 return ::contextMatches(context_chain, m_context);
158
159 // We don't have an exact match, we need to bottom m_context.size() items to
160 // match for a successful lookup.
161 if (context_chain.size() < m_context.size())
162 return false; // Not enough items in context_chain to allow for a match.
163
164 size_t compare_count = context_chain.size() - m_context.size();
165 return ::contextMatches(
166 llvm::ArrayRef<CompilerContext>(context_chain.data() + compare_count,
167 m_context.size()),
168 m_context);
169}
170
172 // If we have no language filterm language always matches.
173 if (!m_languages.has_value())
174 return true;
175 return (*m_languages)[language];
176}
177
179 return !m_searched_symbol_files.insert(sym_file).second;
180}
181
183 if (type_sp)
184 return m_type_map.InsertUnique(type_sp);
185 return false;
186}
187
188bool TypeResults::Done(const TypeQuery &query) const {
189 if (query.GetFindOne())
190 return !m_type_map.Empty();
191 return false;
192}
193
195 switch (kind) {
196 default:
197 s << "Invalid";
198 break;
200 s << "TranslationUnit";
201 break;
203 s << "Module";
204 break;
206 s << "Namespace";
207 break;
209 s << "ClassOrStruct";
210 break;
212 s << "Union";
213 break;
215 s << "Function";
216 break;
218 s << "Variable";
219 break;
221 s << "Enumeration";
222 break;
224 s << "Typedef";
225 break;
227 s << "AnyModule";
228 break;
230 s << "AnyType";
231 break;
232 }
233 s << "(" << name << ")";
234}
235
237public:
238 TypeAppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
239
240 bool operator()(const lldb::TypeSP &type) {
241 m_type_list.Append(TypeImplSP(new TypeImpl(type)));
242 return true;
243 }
244
245private:
247};
248
250 TypeAppendVisitor cb(*this);
251 type_list.ForEach(cb);
252}
253
255 const lldb::TypeSP &type_sp)
256 : UserID(type_sp ? type_sp->GetID() : LLDB_INVALID_UID),
257 m_symbol_file(symbol_file), m_type_sp(type_sp) {}
258
260 if (!m_type_sp) {
261 Type *resolved_type = m_symbol_file.ResolveTypeUID(GetID());
262 if (resolved_type)
263 m_type_sp = resolved_type->shared_from_this();
264 }
265 return m_type_sp.get();
266}
267
269 std::optional<uint64_t> byte_size, SymbolContextScope *context,
270 user_id_t encoding_uid, EncodingDataType encoding_uid_type,
271 const Declaration &decl, const CompilerType &compiler_type,
272 ResolveState compiler_type_resolve_state, uint32_t opaque_payload)
273 : std::enable_shared_from_this<Type>(), UserID(uid), m_name(name),
274 m_symbol_file(symbol_file), m_context(context),
275 m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type),
276 m_decl(decl), m_compiler_type(compiler_type),
277 m_compiler_type_resolve_state(compiler_type ? compiler_type_resolve_state
278 : ResolveState::Unresolved),
279 m_payload(opaque_payload) {
280 if (byte_size) {
281 m_byte_size = *byte_size;
283 } else {
284 m_byte_size = 0;
285 m_byte_size_has_value = false;
286 }
287}
288
290 : std::enable_shared_from_this<Type>(), UserID(0), m_name("<INVALID TYPE>"),
291 m_payload(0) {
292 m_byte_size = 0;
293 m_byte_size_has_value = false;
294}
295
297 bool show_name, ExecutionContextScope *exe_scope) {
298 *s << "id = " << (const UserID &)*this;
299
300 // Call the name accessor to make sure we resolve the type name
301 if (show_name) {
302 ConstString type_name = GetName();
303 if (type_name) {
304 *s << ", name = \"" << type_name << '"';
305 ConstString qualified_type_name(GetQualifiedName());
306 if (qualified_type_name != type_name) {
307 *s << ", qualified = \"" << qualified_type_name << '"';
308 }
309 }
310 }
311
312 // Call the get byte size accessor so we resolve our byte size
313 if (GetByteSize(exe_scope))
314 s->Printf(", byte-size = %" PRIu64, m_byte_size);
315 bool show_fullpaths = (level == lldb::eDescriptionLevelVerbose);
316 m_decl.Dump(s, show_fullpaths);
317
318 if (m_compiler_type.IsValid()) {
319 *s << ", compiler_type = \"";
321 *s << '"';
322 } else if (m_encoding_uid != LLDB_INVALID_UID) {
323 s->Printf(", type_uid = 0x%8.8" PRIx64, m_encoding_uid);
324 switch (m_encoding_uid_type) {
325 case eEncodingInvalid:
326 break;
327 case eEncodingIsUID:
328 s->PutCString(" (unresolved type)");
329 break;
331 s->PutCString(" (unresolved const type)");
332 break;
334 s->PutCString(" (unresolved restrict type)");
335 break;
337 s->PutCString(" (unresolved volatile type)");
338 break;
340 s->PutCString(" (unresolved atomic type)");
341 break;
343 s->PutCString(" (unresolved typedef)");
344 break;
346 s->PutCString(" (unresolved pointer)");
347 break;
349 s->PutCString(" (unresolved L value reference)");
350 break;
352 s->PutCString(" (unresolved R value reference)");
353 break;
355 s->PutCString(" (synthetic type)");
356 break;
358 s->PutCString(" (ptrauth type)");
359 break;
360 }
361 }
362}
363
364void Type::Dump(Stream *s, bool show_context, lldb::DescriptionLevel level) {
365 s->Printf("%p: ", static_cast<void *>(this));
366 s->Indent();
367 *s << "Type" << static_cast<const UserID &>(*this) << ' ';
368 if (m_name)
369 *s << ", name = \"" << m_name << "\"";
370
372 s->Printf(", size = %" PRIu64, m_byte_size);
373
374 if (show_context && m_context != nullptr) {
375 s->PutCString(", context = ( ");
377 s->PutCString(" )");
378 }
379
380 bool show_fullpaths = false;
381 m_decl.Dump(s, show_fullpaths);
382
383 if (m_compiler_type.IsValid()) {
384 *s << ", compiler_type = " << m_compiler_type.GetOpaqueQualType() << ' ';
386 } else if (m_encoding_uid != LLDB_INVALID_UID) {
387 s->Format(", type_data = {0:x-16}", m_encoding_uid);
388 switch (m_encoding_uid_type) {
389 case eEncodingInvalid:
390 break;
391 case eEncodingIsUID:
392 s->PutCString(" (unresolved type)");
393 break;
395 s->PutCString(" (unresolved const type)");
396 break;
398 s->PutCString(" (unresolved restrict type)");
399 break;
401 s->PutCString(" (unresolved volatile type)");
402 break;
404 s->PutCString(" (unresolved atomic type)");
405 break;
407 s->PutCString(" (unresolved typedef)");
408 break;
410 s->PutCString(" (unresolved pointer)");
411 break;
413 s->PutCString(" (unresolved L value reference)");
414 break;
416 s->PutCString(" (unresolved R value reference)");
417 break;
419 s->PutCString(" (synthetic type)");
420 break;
422 s->PutCString(" (ptrauth type)");
423 }
424 }
425
426 //
427 // if (m_access)
428 // s->Printf(", access = %u", m_access);
429 s->EOL();
430}
431
433 if (!m_name)
435 return m_name;
436}
437
439 return GetForwardCompilerType().GetTypeName(/*BaseOnly*/ true);
440}
441
442void Type::DumpTypeName(Stream *s) { GetName().Dump(s, "<invalid-type-name>"); }
443
447 return m_encoding_type;
448}
449
450std::optional<uint64_t> Type::GetByteSize(ExecutionContextScope *exe_scope) {
452 return static_cast<uint64_t>(m_byte_size);
453
454 switch (m_encoding_uid_type) {
455 case eEncodingInvalid:
457 break;
458 case eEncodingIsUID:
464 Type *encoding_type = GetEncodingType();
465 if (encoding_type)
466 if (std::optional<uint64_t> size =
467 encoding_type->GetByteSize(exe_scope)) {
468 m_byte_size = *size;
470 return static_cast<uint64_t>(m_byte_size);
471 }
472
473 if (std::optional<uint64_t> size =
474 GetLayoutCompilerType().GetByteSize(exe_scope)) {
475 m_byte_size = *size;
477 return static_cast<uint64_t>(m_byte_size);
478 }
479 } break;
480
481 // If we are a pointer or reference, then this is just a pointer size;
487 m_byte_size = arch.GetAddressByteSize();
489 return static_cast<uint64_t>(m_byte_size);
490 }
491 } break;
492 }
493 return {};
494}
495
496llvm::Expected<uint32_t> Type::GetNumChildren(bool omit_empty_base_classes) {
497 return GetForwardCompilerType().GetNumChildren(omit_empty_base_classes, nullptr);
498}
499
502}
503
506}
507
509 lldb::TypeSP type_sp;
510 if (IsTypedef()) {
512 if (typedef_type)
513 type_sp = typedef_type->shared_from_this();
514 }
515 return type_sp;
516}
517
519
521 // Make sure we resolve our type if it already hasn't been.
522 return GetForwardCompilerType().GetEncoding(count);
523}
524
526 AddressType address_type, DataExtractor &data) {
527 if (address_type == eAddressTypeFile) {
528 // Can't convert a file address to anything valid without more context
529 // (which Module it came from)
530 return false;
531 }
532
533 const uint64_t byte_size =
534 GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr)
535 .value_or(0);
536 if (data.GetByteSize() < byte_size) {
537 lldb::DataBufferSP data_sp(new DataBufferHeap(byte_size, '\0'));
538 data.SetData(data_sp);
539 }
540
541 uint8_t *dst = const_cast<uint8_t *>(data.PeekData(0, byte_size));
542 if (dst != nullptr) {
543 if (address_type == eAddressTypeHost) {
544 // The address is an address in this process, so just copy it
545 if (addr == 0)
546 return false;
547 memcpy(dst, reinterpret_cast<uint8_t *>(addr), byte_size);
548 return true;
549 } else {
550 if (exe_ctx) {
551 Process *process = exe_ctx->GetProcessPtr();
552 if (process) {
554 return exe_ctx->GetProcessPtr()->ReadMemory(addr, dst, byte_size,
555 error) == byte_size;
556 }
557 }
558 }
559 }
560 return false;
561}
562
564 AddressType address_type, DataExtractor &data) {
565 return false;
566}
567
568const Declaration &Type::GetDeclaration() const { return m_decl; }
569
570bool Type::ResolveCompilerType(ResolveState compiler_type_resolve_state) {
571 // TODO: This needs to consider the correct type system to use.
572 Type *encoding_type = nullptr;
573 if (!m_compiler_type.IsValid()) {
574 encoding_type = GetEncodingType();
575 if (encoding_type) {
576 switch (m_encoding_uid_type) {
577 case eEncodingIsUID: {
578 CompilerType encoding_compiler_type =
579 encoding_type->GetForwardCompilerType();
580 if (encoding_compiler_type.IsValid()) {
581 m_compiler_type = encoding_compiler_type;
583 encoding_type->m_compiler_type_resolve_state;
584 }
585 } break;
586
589 encoding_type->GetForwardCompilerType().AddConstModifier();
590 break;
591
595 break;
596
600 break;
601
604 encoding_type->GetForwardCompilerType().GetAtomicType();
605 break;
606
609 m_name.AsCString("__lldb_invalid_typedef_name"),
610 GetSymbolFile()->GetDeclContextContainingUID(GetID()), m_payload);
611 m_name.Clear();
612 break;
613
616 encoding_type->GetForwardCompilerType().GetPointerType();
617 break;
618
622 break;
623
627 break;
628
632 m_payload);
633 break;
634
635 default:
636 llvm_unreachable("Unhandled encoding_data_type.");
637 }
638 } else {
639 // We have no encoding type, return void?
640 auto type_system_or_err =
642 if (auto err = type_system_or_err.takeError()) {
644 GetLog(LLDBLog::Symbols), std::move(err),
645 "Unable to construct void type from TypeSystemClang: {0}");
646 } else {
647 CompilerType void_compiler_type;
648 auto ts = *type_system_or_err;
649 if (ts)
650 void_compiler_type = ts->GetBasicTypeFromAST(eBasicTypeVoid);
651 switch (m_encoding_uid_type) {
652 case eEncodingIsUID:
653 m_compiler_type = void_compiler_type;
654 break;
655
657 m_compiler_type = void_compiler_type.AddConstModifier();
658 break;
659
661 m_compiler_type = void_compiler_type.AddRestrictModifier();
662 break;
663
665 m_compiler_type = void_compiler_type.AddVolatileModifier();
666 break;
667
669 m_compiler_type = void_compiler_type.GetAtomicType();
670 break;
671
673 m_compiler_type = void_compiler_type.CreateTypedef(
674 m_name.AsCString("__lldb_invalid_typedef_name"),
675 GetSymbolFile()->GetDeclContextContainingUID(GetID()), m_payload);
676 break;
677
679 m_compiler_type = void_compiler_type.GetPointerType();
680 break;
681
683 m_compiler_type = void_compiler_type.GetLValueReferenceType();
684 break;
685
687 m_compiler_type = void_compiler_type.GetRValueReferenceType();
688 break;
689
691 llvm_unreachable("Cannot handle eEncodingIsLLVMPtrAuthUID without "
692 "valid encoding_type");
693
694 default:
695 llvm_unreachable("Unhandled encoding_data_type.");
696 }
697 }
698 }
699
700 // When we have a EncodingUID, our "m_flags.compiler_type_resolve_state" is
701 // set to eResolveStateUnresolved so we need to update it to say that we
702 // now have a forward declaration since that is what we created above.
705 }
706
707 // Check if we have a forward reference to a class/struct/union/enum?
708 if (compiler_type_resolve_state == ResolveState::Layout ||
709 compiler_type_resolve_state == ResolveState::Full) {
710 // Check if we have a forward reference to a class/struct/union/enum?
711 if (m_compiler_type.IsValid() &&
712 m_compiler_type_resolve_state < compiler_type_resolve_state) {
714 if (!m_compiler_type.IsDefined()) {
715 // We have a forward declaration, we need to resolve it to a complete
716 // definition.
718 }
719 }
720 }
721
722 // If we have an encoding type, then we need to make sure it is resolved
723 // appropriately.
725 if (encoding_type == nullptr)
726 encoding_type = GetEncodingType();
727 if (encoding_type) {
728 ResolveState encoding_compiler_type_resolve_state =
729 compiler_type_resolve_state;
730
731 if (compiler_type_resolve_state == ResolveState::Layout) {
732 switch (m_encoding_uid_type) {
736 encoding_compiler_type_resolve_state = ResolveState::Forward;
737 break;
738 default:
739 break;
740 }
741 }
742 encoding_type->ResolveCompilerType(encoding_compiler_type_resolve_state);
743 }
744 }
745 return m_compiler_type.IsValid();
746}
748 uint32_t encoding_mask = 1u << m_encoding_uid_type;
749 Type *encoding_type = GetEncodingType();
750 assert(encoding_type != this);
751 if (encoding_type)
752 encoding_mask |= encoding_type->GetEncodingMask();
753 return encoding_mask;
754}
755
758 return m_compiler_type;
759}
760
763 return m_compiler_type;
764}
765
768 return m_compiler_type;
769}
770
773}
774
775std::optional<Type::ParsedName>
776Type::GetTypeScopeAndBasename(llvm::StringRef name) {
777 ParsedName result;
778
779 if (name.empty())
780 return std::nullopt;
781
782 if (name.consume_front("struct "))
783 result.type_class = eTypeClassStruct;
784 else if (name.consume_front("class "))
785 result.type_class = eTypeClassClass;
786 else if (name.consume_front("union "))
787 result.type_class = eTypeClassUnion;
788 else if (name.consume_front("enum "))
789 result.type_class = eTypeClassEnumeration;
790 else if (name.consume_front("typedef "))
791 result.type_class = eTypeClassTypedef;
792
793 if (name.consume_front("::"))
794 result.scope.push_back("::");
795
796 bool prev_is_colon = false;
797 size_t template_depth = 0;
798 size_t name_begin = 0;
799 for (const auto &pos : llvm::enumerate(name)) {
800 switch (pos.value()) {
801 case ':':
802 if (prev_is_colon && template_depth == 0) {
803 result.scope.push_back(name.slice(name_begin, pos.index() - 1));
804 name_begin = pos.index() + 1;
805 }
806 break;
807 case '<':
808 ++template_depth;
809 break;
810 case '>':
811 if (template_depth == 0)
812 return std::nullopt; // Invalid name.
813 --template_depth;
814 break;
815 }
816 prev_is_colon = pos.value() == ':';
817 }
818
819 if (name_begin < name.size() && template_depth == 0)
820 result.basename = name.substr(name_begin);
821 else
822 return std::nullopt;
823
824 return result;
825}
826
828 if (m_symbol_file)
830 return ModuleSP();
831}
832
834 if (m_compiler_type) {
835 auto ts = m_compiler_type.GetTypeSystem();
836 if (!ts)
837 return {};
838 SymbolFile *symbol_file = ts->GetSymbolFile();
839 if (symbol_file)
840 return symbol_file->GetObjectFile()->GetModule();
841 }
842 return {};
843}
844
846 if (in_type_sp) {
847 m_compiler_type = in_type_sp->GetForwardCompilerType();
848 m_type_name = in_type_sp->GetName();
849 }
850}
851
852TypeAndOrName::TypeAndOrName(const char *in_type_str)
853 : m_type_name(in_type_str) {}
854
856 : m_type_name(in_type_const_string) {}
857
858bool TypeAndOrName::operator==(const TypeAndOrName &other) const {
859 if (m_compiler_type != other.m_compiler_type)
860 return false;
861 if (m_type_name != other.m_type_name)
862 return false;
863 return true;
864}
865
866bool TypeAndOrName::operator!=(const TypeAndOrName &other) const {
867 return !(*this == other);
868}
869
871 if (m_type_name)
872 return m_type_name;
873 if (m_compiler_type)
875 return ConstString("<invalid>");
876}
877
879 m_type_name = type_name;
880}
881
882void TypeAndOrName::SetName(const char *type_name_cstr) {
883 m_type_name.SetCString(type_name_cstr);
884}
885
886void TypeAndOrName::SetName(llvm::StringRef type_name) {
887 m_type_name.SetString(type_name);
888}
889
891 if (type_sp) {
892 m_compiler_type = type_sp->GetForwardCompilerType();
893 m_type_name = type_sp->GetName();
894 } else
895 Clear();
896}
897
899 m_compiler_type = compiler_type;
900 if (m_compiler_type)
902}
903
905 return !((bool)m_type_name || (bool)m_compiler_type);
906}
907
911}
912
913bool TypeAndOrName::HasName() const { return (bool)m_type_name; }
914
916 return m_compiler_type.IsValid();
917}
918
920 : m_module_wp(), m_static_type(), m_dynamic_type() {
921 SetType(type_sp);
922}
923
924TypeImpl::TypeImpl(const CompilerType &compiler_type)
925 : m_module_wp(), m_static_type(), m_dynamic_type() {
926 SetType(compiler_type);
927}
928
929TypeImpl::TypeImpl(const lldb::TypeSP &type_sp, const CompilerType &dynamic)
930 : m_module_wp(), m_static_type(), m_dynamic_type(dynamic) {
931 SetType(type_sp, dynamic);
932}
933
935 const CompilerType &dynamic_type)
936 : m_module_wp(), m_static_type(), m_dynamic_type() {
937 SetType(static_type, dynamic_type);
938}
939
940void TypeImpl::SetType(const lldb::TypeSP &type_sp) {
941 if (type_sp) {
942 m_static_type = type_sp->GetForwardCompilerType();
943 m_exe_module_wp = type_sp->GetExeModule();
944 m_module_wp = type_sp->GetModule();
945 } else {
948 }
949}
950
951void TypeImpl::SetType(const CompilerType &compiler_type) {
953 m_static_type = compiler_type;
954}
955
956void TypeImpl::SetType(const lldb::TypeSP &type_sp,
957 const CompilerType &dynamic) {
958 SetType(type_sp);
959 m_dynamic_type = dynamic;
960}
961
962void TypeImpl::SetType(const CompilerType &compiler_type,
963 const CompilerType &dynamic) {
965 m_static_type = compiler_type;
966 m_dynamic_type = dynamic;
967}
968
969bool TypeImpl::CheckModule(lldb::ModuleSP &module_sp) const {
970 return CheckModuleCommon(m_module_wp, module_sp);
971}
972
974 return CheckModuleCommon(m_exe_module_wp, module_sp);
975}
976
977bool TypeImpl::CheckModuleCommon(const lldb::ModuleWP &input_module_wp,
978 lldb::ModuleSP &module_sp) const {
979 // Check if we have a module for this type. If we do and the shared pointer
980 // is can be successfully initialized with m_module_wp, return true. Else
981 // return false if we didn't have a module, or if we had a module and it has
982 // been deleted. Any functions doing anything with a TypeSP in this TypeImpl
983 // class should call this function and only do anything with the ivars if
984 // this function returns true. If we have a module, the "module_sp" will be
985 // filled in with a strong reference to the module so that the module will at
986 // least stay around long enough for the type query to succeed.
987 module_sp = input_module_wp.lock();
988 if (!module_sp) {
989 lldb::ModuleWP empty_module_wp;
990 // If either call to "std::weak_ptr::owner_before(...) value returns true,
991 // this indicates that m_module_wp once contained (possibly still does) a
992 // reference to a valid shared pointer. This helps us know if we had a
993 // valid reference to a section which is now invalid because the module it
994 // was in was deleted
995 if (empty_module_wp.owner_before(input_module_wp) ||
996 input_module_wp.owner_before(empty_module_wp)) {
997 // input_module_wp had a valid reference to a module, but all strong
998 // references have been released and the module has been deleted
999 return false;
1000 }
1001 }
1002 // We either successfully locked the module, or didn't have one to begin with
1003 return true;
1004}
1005
1006bool TypeImpl::operator==(const TypeImpl &rhs) const {
1007 return m_static_type == rhs.m_static_type &&
1009}
1010
1011bool TypeImpl::operator!=(const TypeImpl &rhs) const {
1012 return !(*this == rhs);
1013}
1014
1015bool TypeImpl::IsValid() const {
1016 // just a name is not valid
1017 ModuleSP module_sp;
1018 if (CheckModule(module_sp))
1020 return false;
1021}
1022
1023TypeImpl::operator bool() const { return IsValid(); }
1024
1029}
1030
1032 lldb::ModuleSP module_sp;
1033 if (CheckExeModule(module_sp))
1034 return module_sp;
1035 return nullptr;
1036}
1037
1039 ModuleSP module_sp;
1040 if (CheckModule(module_sp)) {
1041 if (m_dynamic_type)
1042 return m_dynamic_type.GetTypeName();
1043 return m_static_type.GetTypeName();
1044 }
1045 return ConstString();
1046}
1047
1049 ModuleSP module_sp;
1050 if (CheckModule(module_sp)) {
1051 if (m_dynamic_type)
1054 }
1055 return ConstString();
1056}
1057
1059 ModuleSP module_sp;
1060 if (CheckModule(module_sp)) {
1061 if (m_dynamic_type.IsValid()) {
1064 }
1066 }
1067 return TypeImpl();
1068}
1069
1071 ModuleSP module_sp;
1072 if (CheckModule(module_sp)) {
1073 if (m_dynamic_type.IsValid()) {
1076 }
1078 }
1079 return TypeImpl();
1080}
1081
1083 ModuleSP module_sp;
1084 if (CheckModule(module_sp)) {
1085 if (m_dynamic_type.IsValid()) {
1088 }
1090 }
1091 return TypeImpl();
1092}
1093
1095 ModuleSP module_sp;
1096 if (CheckModule(module_sp)) {
1097 if (m_dynamic_type.IsValid()) {
1100 }
1102 }
1103 return TypeImpl();
1104}
1105
1107 ModuleSP module_sp;
1108 if (CheckModule(module_sp)) {
1109 if (m_dynamic_type.IsValid()) {
1112 }
1114 }
1115 return TypeImpl();
1116}
1117
1119 ModuleSP module_sp;
1120 if (CheckModule(module_sp)) {
1121 if (m_dynamic_type.IsValid()) {
1124 }
1126 }
1127 return TypeImpl();
1128}
1129
1131 ModuleSP module_sp;
1132 if (CheckModule(module_sp)) {
1133 if (m_dynamic_type.IsValid()) {
1136 }
1138 }
1139 return TypeImpl();
1140}
1141
1143 ModuleSP module_sp;
1144 if (CheckModule(module_sp)) {
1145 if (prefer_dynamic) {
1146 if (m_dynamic_type.IsValid())
1147 return m_dynamic_type;
1148 }
1149 return m_static_type;
1150 }
1151 return CompilerType();
1152}
1153
1155 ModuleSP module_sp;
1156 if (CheckModule(module_sp)) {
1157 if (prefer_dynamic) {
1158 if (m_dynamic_type.IsValid())
1160 }
1162 }
1163 return {};
1164}
1165
1167 lldb::DescriptionLevel description_level) {
1168 ModuleSP module_sp;
1169 if (CheckModule(module_sp)) {
1170 if (m_dynamic_type.IsValid()) {
1171 strm.Printf("Dynamic:\n");
1173 strm.Printf("\nStatic:\n");
1174 }
1176 } else {
1177 strm.PutCString("Invalid TypeImpl module for type has been deleted\n");
1178 }
1179 return true;
1180}
1181
1183 if (name.empty())
1184 return CompilerType();
1185 return GetCompilerType(/*prefer_dynamic=*/false)
1187}
1188
1191}
1192
1194
1196 return m_decl.GetMangledName();
1197}
1198
1200
1202 return m_kind;
1203}
1204
1206 switch (m_kind) {
1208 return false;
1210 stream.Printf("constructor for %s",
1211 m_type.GetTypeName().AsCString("<unknown>"));
1212 break;
1214 stream.Printf("destructor for %s",
1215 m_type.GetTypeName().AsCString("<unknown>"));
1216 break;
1218 stream.Printf("instance method %s of type %s", m_name.AsCString(),
1220 break;
1222 stream.Printf("static method %s of type %s", m_name.AsCString(),
1224 break;
1225 }
1226 return true;
1227}
1228
1230 if (m_type)
1233}
1234
1236 if (m_type)
1238 else
1240}
1241
1243 if (m_type)
1245 else
1246 return m_decl.GetFunctionArgumentType(idx);
1247}
1248
1250 ConstString name,
1251 const llvm::APSInt &value)
1252 : m_integer_type_sp(integer_type_sp), m_name(name), m_value(value),
1253 m_valid((bool)name && (bool)integer_type_sp)
1254
1255{}
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:75
bool operator()(const lldb::TypeSP &type)
Definition: Type.cpp:240
TypeListImpl & m_type_list
Definition: Type.cpp:246
TypeAppendVisitor(TypeListImpl &type_list)
Definition: Type.cpp:238
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:232
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:1970
An error handling class.
Definition: Status.h:44
llvm::StringRef GetString() const
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:377
SymbolFileType(SymbolFile &symbol_file, lldb::user_id_t uid)
Definition: Type.h:364
lldb::TypeSP m_type_sp
Definition: Type.h:378
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:743
void SetName(ConstString type_name)
Definition: Type.cpp:878
bool operator!=(const TypeAndOrName &other) const
Definition: Type.cpp:866
bool operator==(const TypeAndOrName &other) const
Definition: Type.cpp:858
bool HasName() const
Definition: Type.cpp:913
ConstString GetName() const
Definition: Type.cpp:870
bool HasCompilerType() const
Definition: Type.cpp:915
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:898
ConstString m_type_name
Definition: Type.h:783
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:890
CompilerType m_compiler_type
Definition: Type.h:782
bool IsEmpty() const
Definition: Type.cpp:904
CompilerType GetCompilerType(bool prefer_dynamic)
Definition: Type.cpp:1142
bool operator!=(const TypeImpl &rhs) const
Definition: Type.cpp:1011
bool CheckExeModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:973
bool GetDescription(lldb_private::Stream &strm, lldb::DescriptionLevel description_level)
Definition: Type.cpp:1166
bool operator==(const TypeImpl &rhs) const
Definition: Type.cpp:1006
bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp, lldb::ModuleSP &module_sp) const
Definition: Type.cpp:977
TypeImpl GetCanonicalType() const
Definition: Type.cpp:1130
void SetType(const lldb::TypeSP &type_sp)
Definition: Type.cpp:940
TypeImpl GetUnqualifiedType() const
Definition: Type.cpp:1118
TypeImpl GetPointeeType() const
Definition: Type.cpp:1070
CompilerType m_dynamic_type
Definition: Type.h:658
CompilerType::TypeSystemSPWrapper GetTypeSystem(bool prefer_dynamic)
Definition: Type.cpp:1154
CompilerType m_static_type
Definition: Type.h:657
bool CheckModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:969
lldb::ModuleSP GetModule() const
Definition: Type.cpp:1031
TypeImpl GetDereferencedType() const
Definition: Type.cpp:1106
bool IsValid() const
Definition: Type.cpp:1015
TypeImpl GetPointerType() const
Definition: Type.cpp:1058
lldb::ModuleWP m_exe_module_wp
Definition: Type.h:656
TypeImpl GetReferenceType() const
Definition: Type.cpp:1082
TypeImpl GetTypedefedType() const
Definition: Type.cpp:1094
lldb::ModuleWP m_module_wp
Definition: Type.h:655
ConstString GetName() const
Definition: Type.cpp:1038
CompilerType FindDirectNestedType(llvm::StringRef name)
Definition: Type.cpp:1182
ConstString GetDisplayTypeName() const
Definition: Type.cpp:1048
void Append(const lldb::TypeImplSP &type)
Definition: Type.h:665
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:1229
ConstString GetMangledName() const
Definition: Type.cpp:1195
CompilerType GetType() const
Definition: Type.cpp:1199
ConstString GetName() const
Definition: Type.cpp:1193
CompilerType GetArgumentAtIndex(size_t idx) const
Definition: Type.cpp:1242
bool GetDescription(Stream &stream)
Definition: Type.cpp:1205
lldb::MemberFunctionKind GetKind() const
Definition: Type.cpp:1201
lldb::MemberFunctionKind m_kind
Definition: Type.h:820
A class that contains all state required for type lookups.
Definition: Type.h:100
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:294
void AddLanguage(lldb::LanguageType language)
Add a language family to the list of languages that should produce a match.
Definition: Type.cpp:144
TypeQueryOptions m_options
An options bitmask that contains enabled options for the type query.
Definition: Type.h:297
bool LanguageMatches(lldb::LanguageType language) const
Check if the language matches any languages that have been added to this match object.
Definition: Type.cpp:171
bool GetExactMatch() const
Definition: Type.h:266
void SetLanguages(LanguageSet languages)
Set the list of languages that should produce a match to only the ones specified in languages.
Definition: Type.cpp:150
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:301
ConstString GetTypeBasename() const
Get the type basename to use when searching the type indexes in each SymbolFile object.
Definition: Type.cpp:138
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:154
bool GetFindOne() const
Returns true if the type query is supposed to find only a single matching type.
Definition: Type.h:275
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:182
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:358
bool Done(const TypeQuery &query) const
Check if the type matching has found all of the matches that it needs.
Definition: Type.cpp:188
bool AlreadySearched(lldb_private::SymbolFile *sym_file)
Check if a SymbolFile object has already been searched by this type match object.
Definition: Type.cpp:178
TypeMap m_type_map
Matching types get added to this map as type search continues.
Definition: Type.h:355
Type * m_encoding_type
Definition: Type.h:545
CompilerType m_compiler_type
Definition: Type.h:551
CompilerType GetForwardCompilerType()
Definition: Type.cpp:766
lldb::Format GetFormat()
Definition: Type.cpp:518
Declaration m_decl
Definition: Type.h:550
Type * GetEncodingType()
Definition: Type.cpp:444
ConstString GetName()
Definition: Type.cpp:432
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:568
uint64_t m_byte_size_has_value
Definition: Type.h:549
bool IsTemplateType()
Definition: Type.cpp:504
ResolveState m_compiler_type_resolve_state
Definition: Type.h:552
ConstString m_name
Definition: Type.h:541
uint32_t GetEncodingMask()
Definition: Type.cpp:747
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:296
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes)
Definition: Type.cpp:496
SymbolContextScope * m_context
The symbol context in which this type is defined.
Definition: Type.h:544
lldb::user_id_t m_encoding_uid
Definition: Type.h:546
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
Definition: Type.h:393
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
Definition: Type.h:390
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
Definition: Type.h:396
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
Definition: Type.h:406
@ eEncodingIsLLVMPtrAuthUID
This type is a signed pointer.
Definition: Type.h:410
@ eEncodingIsSyntheticUID
This type is the synthetic type whose UID is m_encoding_uid.
Definition: Type.h:408
@ eEncodingInvalid
Invalid encoding.
Definition: Type.h:385
@ eEncodingIsTypedefUID
This type is alias to a type whose UID is m_encoding_uid.
Definition: Type.h:398
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:400
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:402
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:404
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
Definition: Type.h:387
Payload m_payload
Language-specific flags.
Definition: Type.h:554
SymbolFile * GetSymbolFile()
Definition: Type.h:440
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:364
CompilerType GetLayoutCompilerType()
Definition: Type.cpp:761
lldb::Encoding GetEncoding(uint64_t &count)
Definition: Type.cpp:520
lldb::ModuleSP GetExeModule()
GetModule may return module for compile unit's object file.
Definition: Type.cpp:833
void DumpTypeName(Stream *s)
Definition: Type.cpp:442
static std::optional< ParsedName > GetTypeScopeAndBasename(llvm::StringRef name)
Definition: Type.cpp:776
lldb::TypeSP GetTypedefType()
Definition: Type.cpp:508
bool ResolveCompilerType(ResolveState compiler_type_resolve_state)
Definition: Type.cpp:570
SymbolFile * m_symbol_file
Definition: Type.h:542
bool IsAggregateType()
Definition: Type.cpp:500
EncodingDataType m_encoding_uid_type
Definition: Type.h:547
uint64_t m_byte_size
Definition: Type.h:548
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
Definition: Type.cpp:450
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:525
ConstString GetBaseName()
Definition: Type.cpp:438
ConstString GetQualifiedName()
Definition: Type.cpp:771
CompilerType GetFullCompilerType()
Definition: Type.cpp:756
lldb::ModuleSP GetModule()
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sur...
Definition: Type.cpp:827
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:563
bool IsTypedef()
Definition: Type.h:458
#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:46
Stream & operator<<(Stream &s, const Mangled &obj)
@ 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:371
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:456
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:333
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP
Definition: lldb-forward.h:459
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:370
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:194
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:507
lldb::TypeClass type_class
Definition: Type.h:503
llvm::StringRef basename
Definition: Type.h:509
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