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 <algorithm>
10#include <cstdio>
11#include <iterator>
12#include <optional>
13
14#include "lldb/Core/Module.h"
18#include "lldb/Utility/Log.h"
19#include "lldb/Utility/Scalar.h"
21
27#include "lldb/Symbol/Type.h"
30
32#include "lldb/Target/Process.h"
33#include "lldb/Target/Target.h"
36
37#include "llvm/ADT/StringRef.h"
38
39using namespace lldb;
40using namespace lldb_private;
41
42llvm::raw_ostream &lldb_private::operator<<(llvm::raw_ostream &os,
43 const CompilerContext &rhs) {
44 StreamString lldb_stream;
45 rhs.Dump(lldb_stream);
46 return os << lldb_stream.GetString();
47}
48
49static CompilerContextKind ConvertTypeClass(lldb::TypeClass type_class) {
50 if (type_class == eTypeClassAny)
51 return CompilerContextKind::AnyType;
52 CompilerContextKind result = {};
53 if (type_class & (lldb::eTypeClassClass | lldb::eTypeClassStruct))
54 result |= CompilerContextKind::ClassOrStruct;
55 if (type_class & lldb::eTypeClassUnion)
56 result |= CompilerContextKind::Union;
57 if (type_class & lldb::eTypeClassEnumeration)
58 result |= CompilerContextKind::Enum;
59 if (type_class & lldb::eTypeClassFunction)
60 result |= CompilerContextKind::Function;
61 if (type_class & lldb::eTypeClassTypedef)
62 result |= CompilerContextKind::Typedef;
63 return result;
64}
65
66TypeQuery::TypeQuery(llvm::StringRef name, TypeQueryOptions options)
67 : m_options(options) {
68 if (std::optional<Type::ParsedName> parsed_name =
70 llvm::ArrayRef scope = parsed_name->scope;
71 if (!scope.empty()) {
72 if (scope[0] == "::") {
73 m_options |= e_exact_match;
74 scope = scope.drop_front();
75 }
76 for (llvm::StringRef s : scope) {
77 m_context.push_back(
79 }
80 }
81 m_context.push_back({ConvertTypeClass(parsed_name->type_class),
82 ConstString(parsed_name->basename)});
83 } else {
85 }
86}
87
89 ConstString type_basename, TypeQueryOptions options)
90 : m_options(options) {
91 // Always use an exact match if we are looking for a type in compiler context.
92 m_options |= e_exact_match;
93 m_context = decl_ctx.GetCompilerContext();
94 m_context.push_back({CompilerContextKind::AnyType, type_basename});
95}
96
98 const llvm::ArrayRef<lldb_private::CompilerContext> &context,
99 TypeQueryOptions options)
100 : m_context(context), m_options(options) {
101 // Always use an exact match if we are looking for a type in compiler context.
102 m_options |= e_exact_match;
103}
104
105TypeQuery::TypeQuery(const CompilerDecl &decl, TypeQueryOptions options)
106 : m_options(options) {
107 // Always for an exact match if we are looking for a type using a declaration.
108 m_options |= e_exact_match;
110}
111
113 if (m_context.empty())
114 return ConstString();
115 return m_context.back().name;
116}
117
119 if (!m_languages)
121 m_languages->Insert(language);
122}
123
125 m_languages = std::move(languages);
126}
127
129 llvm::ArrayRef<CompilerContext> context_chain) const {
130 auto ctx = context_chain.rbegin(), ctx_end = context_chain.rend();
131 for (auto pat = m_context.rbegin(), pat_end = m_context.rend();
132 pat != pat_end;) {
133
134 if (ctx == ctx_end)
135 return false; // Pattern too long.
136
137 // See if there is a kind mismatch; they should have 1 bit in common.
138 if ((ctx->kind & pat->kind) == CompilerContextKind())
139 return false;
140
141 if (ctx->name != pat->name)
142 return false;
143
144 ++ctx;
145 ++pat;
146 }
147
148 // Skip over any remaining module entries if we were asked to do that.
149 while (GetIgnoreModules() && ctx != ctx_end &&
150 ctx->kind == CompilerContextKind::Module)
151 ++ctx;
152
153 // At this point, we have exhausted the pattern and we have a partial match at
154 // least. If that's all we're looking for, we're done.
155 if (!GetExactMatch())
156 return true;
157
158 // We have an exact match if we've exhausted the target context as well.
159 return ctx == ctx_end;
160}
161
163 // If we have no language filterm language always matches.
164 if (!m_languages.has_value())
165 return true;
166 return (*m_languages)[language];
167}
168
170 return !m_searched_symbol_files.insert(sym_file).second;
171}
172
174 if (type_sp)
175 return m_type_map.InsertUnique(type_sp);
176 return false;
177}
178
179bool TypeResults::Done(const TypeQuery &query) const {
180 if (query.GetFindOne())
181 return !m_type_map.Empty();
182 return false;
183}
184
186 switch (kind) {
187 default:
188 s << "Invalid";
189 break;
191 s << "TranslationUnit";
192 break;
194 s << "Module";
195 break;
197 s << "Namespace";
198 break;
200 s << "ClassOrStruct";
201 break;
203 s << "Union";
204 break;
206 s << "Function";
207 break;
209 s << "Variable";
210 break;
212 s << "Enumeration";
213 break;
215 s << "Typedef";
216 break;
218 s << "AnyType";
219 break;
220 }
221 s << "(" << name << ")";
222}
223
225public:
226 TypeAppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
227
228 bool operator()(const lldb::TypeSP &type) {
229 m_type_list.Append(TypeImplSP(new TypeImpl(type)));
230 return true;
231 }
232
233private:
235};
236
238 TypeAppendVisitor cb(*this);
239 type_list.ForEach(cb);
240}
241
243 const lldb::TypeSP &type_sp)
244 : UserID(type_sp ? type_sp->GetID() : LLDB_INVALID_UID),
245 m_symbol_file(symbol_file), m_type_sp(type_sp) {}
246
248 if (!m_type_sp) {
249 Type *resolved_type = m_symbol_file.ResolveTypeUID(GetID());
250 if (resolved_type)
251 m_type_sp = resolved_type->shared_from_this();
252 }
253 return m_type_sp.get();
254}
255
257 std::optional<uint64_t> byte_size, SymbolContextScope *context,
258 user_id_t encoding_uid, EncodingDataType encoding_uid_type,
259 const Declaration &decl, const CompilerType &compiler_type,
260 ResolveState compiler_type_resolve_state, uint32_t opaque_payload)
261 : std::enable_shared_from_this<Type>(), UserID(uid), m_name(name),
262 m_symbol_file(symbol_file), m_context(context),
263 m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type),
264 m_decl(decl), m_compiler_type(compiler_type),
265 m_compiler_type_resolve_state(compiler_type ? compiler_type_resolve_state
266 : ResolveState::Unresolved),
267 m_payload(opaque_payload) {
268 if (byte_size) {
269 m_byte_size = *byte_size;
271 } else {
272 m_byte_size = 0;
273 m_byte_size_has_value = false;
274 }
275}
276
278 : std::enable_shared_from_this<Type>(), UserID(0), m_name("<INVALID TYPE>"),
279 m_payload(0) {
280 m_byte_size = 0;
281 m_byte_size_has_value = false;
282}
283
285 bool show_name, ExecutionContextScope *exe_scope) {
286 *s << "id = " << (const UserID &)*this;
287
288 // Call the name accessor to make sure we resolve the type name
289 if (show_name) {
290 ConstString type_name = GetName();
291 if (type_name) {
292 *s << ", name = \"" << type_name << '"';
293 ConstString qualified_type_name(GetQualifiedName());
294 if (qualified_type_name != type_name) {
295 *s << ", qualified = \"" << qualified_type_name << '"';
296 }
297 }
298 }
299
300 // Call the get byte size accessor so we resolve our byte size
301 if (GetByteSize(exe_scope))
302 s->Printf(", byte-size = %" PRIu64, m_byte_size);
303 bool show_fullpaths = (level == lldb::eDescriptionLevelVerbose);
304 m_decl.Dump(s, show_fullpaths);
305
306 if (m_compiler_type.IsValid()) {
307 *s << ", compiler_type = \"";
309 *s << '"';
310 } else if (m_encoding_uid != LLDB_INVALID_UID) {
311 s->Printf(", type_uid = 0x%8.8" PRIx64, m_encoding_uid);
312 switch (m_encoding_uid_type) {
313 case eEncodingInvalid:
314 break;
315 case eEncodingIsUID:
316 s->PutCString(" (unresolved type)");
317 break;
319 s->PutCString(" (unresolved const type)");
320 break;
322 s->PutCString(" (unresolved restrict type)");
323 break;
325 s->PutCString(" (unresolved volatile type)");
326 break;
328 s->PutCString(" (unresolved atomic type)");
329 break;
331 s->PutCString(" (unresolved typedef)");
332 break;
334 s->PutCString(" (unresolved pointer)");
335 break;
337 s->PutCString(" (unresolved L value reference)");
338 break;
340 s->PutCString(" (unresolved R value reference)");
341 break;
343 s->PutCString(" (synthetic type)");
344 break;
346 s->PutCString(" (ptrauth type)");
347 break;
348 }
349 }
350}
351
352void Type::Dump(Stream *s, bool show_context, lldb::DescriptionLevel level) {
353 s->Printf("%p: ", static_cast<void *>(this));
354 s->Indent();
355 *s << "Type" << static_cast<const UserID &>(*this) << ' ';
356 if (m_name)
357 *s << ", name = \"" << m_name << "\"";
358
360 s->Printf(", size = %" PRIu64, m_byte_size);
361
362 if (show_context && m_context != nullptr) {
363 s->PutCString(", context = ( ");
365 s->PutCString(" )");
366 }
367
368 bool show_fullpaths = false;
369 m_decl.Dump(s, show_fullpaths);
370
371 if (m_compiler_type.IsValid()) {
372 *s << ", compiler_type = " << m_compiler_type.GetOpaqueQualType() << ' ';
374 } else if (m_encoding_uid != LLDB_INVALID_UID) {
375 s->Format(", type_data = {0:x-16}", m_encoding_uid);
376 switch (m_encoding_uid_type) {
377 case eEncodingInvalid:
378 break;
379 case eEncodingIsUID:
380 s->PutCString(" (unresolved type)");
381 break;
383 s->PutCString(" (unresolved const type)");
384 break;
386 s->PutCString(" (unresolved restrict type)");
387 break;
389 s->PutCString(" (unresolved volatile type)");
390 break;
392 s->PutCString(" (unresolved atomic type)");
393 break;
395 s->PutCString(" (unresolved typedef)");
396 break;
398 s->PutCString(" (unresolved pointer)");
399 break;
401 s->PutCString(" (unresolved L value reference)");
402 break;
404 s->PutCString(" (unresolved R value reference)");
405 break;
407 s->PutCString(" (synthetic type)");
408 break;
410 s->PutCString(" (ptrauth type)");
411 }
412 }
413
414 //
415 // if (m_access)
416 // s->Printf(", access = %u", m_access);
417 s->EOL();
418}
419
421 if (!m_name)
423 return m_name;
424}
425
427 return GetForwardCompilerType().GetTypeName(/*BaseOnly*/ true);
428}
429
430void Type::DumpTypeName(Stream *s) { GetName().Dump(s, "<invalid-type-name>"); }
431
435 return m_encoding_type;
436}
437
438std::optional<uint64_t> Type::GetByteSize(ExecutionContextScope *exe_scope) {
440 return static_cast<uint64_t>(m_byte_size);
441
442 switch (m_encoding_uid_type) {
443 case eEncodingInvalid:
445 break;
446 case eEncodingIsUID:
452 Type *encoding_type = GetEncodingType();
453 if (encoding_type)
454 if (std::optional<uint64_t> size =
455 encoding_type->GetByteSize(exe_scope)) {
456 m_byte_size = *size;
458 return static_cast<uint64_t>(m_byte_size);
459 }
460
461 if (std::optional<uint64_t> size =
462 GetLayoutCompilerType().GetByteSize(exe_scope)) {
463 m_byte_size = *size;
465 return static_cast<uint64_t>(m_byte_size);
466 }
467 } break;
468
469 // If we are a pointer or reference, then this is just a pointer size;
475 m_byte_size = arch.GetAddressByteSize();
477 return static_cast<uint64_t>(m_byte_size);
478 }
479 } break;
480 }
481 return {};
482}
483
484llvm::Expected<uint32_t> Type::GetNumChildren(bool omit_empty_base_classes) {
485 return GetForwardCompilerType().GetNumChildren(omit_empty_base_classes, nullptr);
486}
487
490}
491
494}
495
497 lldb::TypeSP type_sp;
498 if (IsTypedef()) {
500 if (typedef_type)
501 type_sp = typedef_type->shared_from_this();
502 }
503 return type_sp;
504}
505
507
509 // Make sure we resolve our type if it already hasn't been.
510 return GetForwardCompilerType().GetEncoding(count);
511}
512
514 AddressType address_type, DataExtractor &data) {
515 if (address_type == eAddressTypeFile) {
516 // Can't convert a file address to anything valid without more context
517 // (which Module it came from)
518 return false;
519 }
520
521 const uint64_t byte_size =
522 GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr)
523 .value_or(0);
524 if (data.GetByteSize() < byte_size) {
525 lldb::DataBufferSP data_sp(new DataBufferHeap(byte_size, '\0'));
526 data.SetData(data_sp);
527 }
528
529 uint8_t *dst = const_cast<uint8_t *>(data.PeekData(0, byte_size));
530 if (dst != nullptr) {
531 if (address_type == eAddressTypeHost) {
532 // The address is an address in this process, so just copy it
533 if (addr == 0)
534 return false;
535 memcpy(dst, reinterpret_cast<uint8_t *>(addr), byte_size);
536 return true;
537 } else {
538 if (exe_ctx) {
539 Process *process = exe_ctx->GetProcessPtr();
540 if (process) {
542 return exe_ctx->GetProcessPtr()->ReadMemory(addr, dst, byte_size,
543 error) == byte_size;
544 }
545 }
546 }
547 }
548 return false;
549}
550
552 AddressType address_type, DataExtractor &data) {
553 return false;
554}
555
556const Declaration &Type::GetDeclaration() const { return m_decl; }
557
558bool Type::ResolveCompilerType(ResolveState compiler_type_resolve_state) {
559 // TODO: This needs to consider the correct type system to use.
560 Type *encoding_type = nullptr;
561 if (!m_compiler_type.IsValid()) {
562 encoding_type = GetEncodingType();
563 if (encoding_type) {
564 switch (m_encoding_uid_type) {
565 case eEncodingIsUID: {
566 CompilerType encoding_compiler_type =
567 encoding_type->GetForwardCompilerType();
568 if (encoding_compiler_type.IsValid()) {
569 m_compiler_type = encoding_compiler_type;
571 encoding_type->m_compiler_type_resolve_state;
572 }
573 } break;
574
577 encoding_type->GetForwardCompilerType().AddConstModifier();
578 break;
579
583 break;
584
588 break;
589
592 encoding_type->GetForwardCompilerType().GetAtomicType();
593 break;
594
597 m_name.AsCString("__lldb_invalid_typedef_name"),
598 GetSymbolFile()->GetDeclContextContainingUID(GetID()), m_payload);
599 m_name.Clear();
600 break;
601
604 encoding_type->GetForwardCompilerType().GetPointerType();
605 break;
606
610 break;
611
615 break;
616
620 m_payload);
621 break;
622
623 default:
624 llvm_unreachable("Unhandled encoding_data_type.");
625 }
626 } else {
627 // We have no encoding type, return void?
628 auto type_system_or_err =
630 if (auto err = type_system_or_err.takeError()) {
632 GetLog(LLDBLog::Symbols), std::move(err),
633 "Unable to construct void type from TypeSystemClang: {0}");
634 } else {
635 CompilerType void_compiler_type;
636 auto ts = *type_system_or_err;
637 if (ts)
638 void_compiler_type = ts->GetBasicTypeFromAST(eBasicTypeVoid);
639 switch (m_encoding_uid_type) {
640 case eEncodingIsUID:
641 m_compiler_type = void_compiler_type;
642 break;
643
645 m_compiler_type = void_compiler_type.AddConstModifier();
646 break;
647
649 m_compiler_type = void_compiler_type.AddRestrictModifier();
650 break;
651
653 m_compiler_type = void_compiler_type.AddVolatileModifier();
654 break;
655
657 m_compiler_type = void_compiler_type.GetAtomicType();
658 break;
659
661 m_compiler_type = void_compiler_type.CreateTypedef(
662 m_name.AsCString("__lldb_invalid_typedef_name"),
663 GetSymbolFile()->GetDeclContextContainingUID(GetID()), m_payload);
664 break;
665
667 m_compiler_type = void_compiler_type.GetPointerType();
668 break;
669
671 m_compiler_type = void_compiler_type.GetLValueReferenceType();
672 break;
673
675 m_compiler_type = void_compiler_type.GetRValueReferenceType();
676 break;
677
679 llvm_unreachable("Cannot handle eEncodingIsLLVMPtrAuthUID without "
680 "valid encoding_type");
681
682 default:
683 llvm_unreachable("Unhandled encoding_data_type.");
684 }
685 }
686 }
687
688 // When we have a EncodingUID, our "m_flags.compiler_type_resolve_state" is
689 // set to eResolveStateUnresolved so we need to update it to say that we
690 // now have a forward declaration since that is what we created above.
693 }
694
695 // Check if we have a forward reference to a class/struct/union/enum?
696 if (compiler_type_resolve_state == ResolveState::Layout ||
697 compiler_type_resolve_state == ResolveState::Full) {
698 // Check if we have a forward reference to a class/struct/union/enum?
699 if (m_compiler_type.IsValid() &&
700 m_compiler_type_resolve_state < compiler_type_resolve_state) {
702 if (!m_compiler_type.IsDefined()) {
703 // We have a forward declaration, we need to resolve it to a complete
704 // definition.
706 }
707 }
708 }
709
710 // If we have an encoding type, then we need to make sure it is resolved
711 // appropriately.
713 if (encoding_type == nullptr)
714 encoding_type = GetEncodingType();
715 if (encoding_type) {
716 ResolveState encoding_compiler_type_resolve_state =
717 compiler_type_resolve_state;
718
719 if (compiler_type_resolve_state == ResolveState::Layout) {
720 switch (m_encoding_uid_type) {
724 encoding_compiler_type_resolve_state = ResolveState::Forward;
725 break;
726 default:
727 break;
728 }
729 }
730 encoding_type->ResolveCompilerType(encoding_compiler_type_resolve_state);
731 }
732 }
733 return m_compiler_type.IsValid();
734}
736 uint32_t encoding_mask = 1u << m_encoding_uid_type;
737 Type *encoding_type = GetEncodingType();
738 assert(encoding_type != this);
739 if (encoding_type)
740 encoding_mask |= encoding_type->GetEncodingMask();
741 return encoding_mask;
742}
743
746 return m_compiler_type;
747}
748
751 return m_compiler_type;
752}
753
756 return m_compiler_type;
757}
758
761}
762
763std::optional<Type::ParsedName>
764Type::GetTypeScopeAndBasename(llvm::StringRef name) {
765 ParsedName result;
766
767 if (name.empty())
768 return std::nullopt;
769
770 if (name.consume_front("struct "))
771 result.type_class = eTypeClassStruct;
772 else if (name.consume_front("class "))
773 result.type_class = eTypeClassClass;
774 else if (name.consume_front("union "))
775 result.type_class = eTypeClassUnion;
776 else if (name.consume_front("enum "))
777 result.type_class = eTypeClassEnumeration;
778 else if (name.consume_front("typedef "))
779 result.type_class = eTypeClassTypedef;
780
781 if (name.consume_front("::"))
782 result.scope.push_back("::");
783
784 bool prev_is_colon = false;
785 size_t template_depth = 0;
786 size_t name_begin = 0;
787 for (const auto &pos : llvm::enumerate(name)) {
788 switch (pos.value()) {
789 case ':':
790 if (prev_is_colon && template_depth == 0) {
791 result.scope.push_back(name.slice(name_begin, pos.index() - 1));
792 name_begin = pos.index() + 1;
793 }
794 break;
795 case '<':
796 ++template_depth;
797 break;
798 case '>':
799 if (template_depth == 0)
800 return std::nullopt; // Invalid name.
801 --template_depth;
802 break;
803 }
804 prev_is_colon = pos.value() == ':';
805 }
806
807 if (name_begin < name.size() && template_depth == 0)
808 result.basename = name.substr(name_begin);
809 else
810 return std::nullopt;
811
812 return result;
813}
814
816 if (m_symbol_file)
818 return ModuleSP();
819}
820
822 if (m_compiler_type) {
823 auto ts = m_compiler_type.GetTypeSystem();
824 if (!ts)
825 return {};
826 SymbolFile *symbol_file = ts->GetSymbolFile();
827 if (symbol_file)
828 return symbol_file->GetObjectFile()->GetModule();
829 }
830 return {};
831}
832
834 if (in_type_sp) {
835 m_compiler_type = in_type_sp->GetForwardCompilerType();
836 m_type_name = in_type_sp->GetName();
837 }
838}
839
840TypeAndOrName::TypeAndOrName(const char *in_type_str)
841 : m_type_name(in_type_str) {}
842
844 : m_type_name(in_type_const_string) {}
845
846bool TypeAndOrName::operator==(const TypeAndOrName &other) const {
847 if (m_compiler_type != other.m_compiler_type)
848 return false;
849 if (m_type_name != other.m_type_name)
850 return false;
851 return true;
852}
853
854bool TypeAndOrName::operator!=(const TypeAndOrName &other) const {
855 return !(*this == other);
856}
857
859 if (m_type_name)
860 return m_type_name;
861 if (m_compiler_type)
863 return ConstString("<invalid>");
864}
865
867 m_type_name = type_name;
868}
869
870void TypeAndOrName::SetName(const char *type_name_cstr) {
871 m_type_name.SetCString(type_name_cstr);
872}
873
874void TypeAndOrName::SetName(llvm::StringRef type_name) {
875 m_type_name.SetString(type_name);
876}
877
879 if (type_sp) {
880 m_compiler_type = type_sp->GetForwardCompilerType();
881 m_type_name = type_sp->GetName();
882 } else
883 Clear();
884}
885
887 m_compiler_type = compiler_type;
888 if (m_compiler_type)
890}
891
893 return !((bool)m_type_name || (bool)m_compiler_type);
894}
895
899}
900
901bool TypeAndOrName::HasName() const { return (bool)m_type_name; }
902
904 return m_compiler_type.IsValid();
905}
906
908 : m_module_wp(), m_static_type(), m_dynamic_type() {
909 SetType(type_sp);
910}
911
912TypeImpl::TypeImpl(const CompilerType &compiler_type)
913 : m_module_wp(), m_static_type(), m_dynamic_type() {
914 SetType(compiler_type);
915}
916
917TypeImpl::TypeImpl(const lldb::TypeSP &type_sp, const CompilerType &dynamic)
918 : m_module_wp(), m_static_type(), m_dynamic_type(dynamic) {
919 SetType(type_sp, dynamic);
920}
921
923 const CompilerType &dynamic_type)
924 : m_module_wp(), m_static_type(), m_dynamic_type() {
925 SetType(static_type, dynamic_type);
926}
927
928void TypeImpl::SetType(const lldb::TypeSP &type_sp) {
929 if (type_sp) {
930 m_static_type = type_sp->GetForwardCompilerType();
931 m_exe_module_wp = type_sp->GetExeModule();
932 m_module_wp = type_sp->GetModule();
933 } else {
936 }
937}
938
939void TypeImpl::SetType(const CompilerType &compiler_type) {
941 m_static_type = compiler_type;
942}
943
944void TypeImpl::SetType(const lldb::TypeSP &type_sp,
945 const CompilerType &dynamic) {
946 SetType(type_sp);
947 m_dynamic_type = dynamic;
948}
949
950void TypeImpl::SetType(const CompilerType &compiler_type,
951 const CompilerType &dynamic) {
953 m_static_type = compiler_type;
954 m_dynamic_type = dynamic;
955}
956
957bool TypeImpl::CheckModule(lldb::ModuleSP &module_sp) const {
958 return CheckModuleCommon(m_module_wp, module_sp);
959}
960
962 return CheckModuleCommon(m_exe_module_wp, module_sp);
963}
964
965bool TypeImpl::CheckModuleCommon(const lldb::ModuleWP &input_module_wp,
966 lldb::ModuleSP &module_sp) const {
967 // Check if we have a module for this type. If we do and the shared pointer
968 // is can be successfully initialized with m_module_wp, return true. Else
969 // return false if we didn't have a module, or if we had a module and it has
970 // been deleted. Any functions doing anything with a TypeSP in this TypeImpl
971 // class should call this function and only do anything with the ivars if
972 // this function returns true. If we have a module, the "module_sp" will be
973 // filled in with a strong reference to the module so that the module will at
974 // least stay around long enough for the type query to succeed.
975 module_sp = input_module_wp.lock();
976 if (!module_sp) {
977 lldb::ModuleWP empty_module_wp;
978 // If either call to "std::weak_ptr::owner_before(...) value returns true,
979 // this indicates that m_module_wp once contained (possibly still does) a
980 // reference to a valid shared pointer. This helps us know if we had a
981 // valid reference to a section which is now invalid because the module it
982 // was in was deleted
983 if (empty_module_wp.owner_before(input_module_wp) ||
984 input_module_wp.owner_before(empty_module_wp)) {
985 // input_module_wp had a valid reference to a module, but all strong
986 // references have been released and the module has been deleted
987 return false;
988 }
989 }
990 // We either successfully locked the module, or didn't have one to begin with
991 return true;
992}
993
994bool TypeImpl::operator==(const TypeImpl &rhs) const {
995 return m_static_type == rhs.m_static_type &&
997}
998
999bool TypeImpl::operator!=(const TypeImpl &rhs) const {
1000 return !(*this == rhs);
1001}
1002
1003bool TypeImpl::IsValid() const {
1004 // just a name is not valid
1005 ModuleSP module_sp;
1006 if (CheckModule(module_sp))
1008 return false;
1009}
1010
1011TypeImpl::operator bool() const { return IsValid(); }
1012
1017}
1018
1020 lldb::ModuleSP module_sp;
1021 if (CheckExeModule(module_sp))
1022 return module_sp;
1023 return nullptr;
1024}
1025
1027 ModuleSP module_sp;
1028 if (CheckModule(module_sp)) {
1029 if (m_dynamic_type)
1030 return m_dynamic_type.GetTypeName();
1031 return m_static_type.GetTypeName();
1032 }
1033 return ConstString();
1034}
1035
1037 ModuleSP module_sp;
1038 if (CheckModule(module_sp)) {
1039 if (m_dynamic_type)
1042 }
1043 return ConstString();
1044}
1045
1047 ModuleSP module_sp;
1048 if (CheckModule(module_sp)) {
1049 if (m_dynamic_type.IsValid()) {
1052 }
1054 }
1055 return TypeImpl();
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 (prefer_dynamic) {
1134 if (m_dynamic_type.IsValid())
1135 return m_dynamic_type;
1136 }
1137 return m_static_type;
1138 }
1139 return CompilerType();
1140}
1141
1143 ModuleSP module_sp;
1144 if (CheckModule(module_sp)) {
1145 if (prefer_dynamic) {
1146 if (m_dynamic_type.IsValid())
1148 }
1150 }
1151 return {};
1152}
1153
1155 lldb::DescriptionLevel description_level) {
1156 ModuleSP module_sp;
1157 if (CheckModule(module_sp)) {
1158 if (m_dynamic_type.IsValid()) {
1159 strm.Printf("Dynamic:\n");
1161 strm.Printf("\nStatic:\n");
1162 }
1164 } else {
1165 strm.PutCString("Invalid TypeImpl module for type has been deleted\n");
1166 }
1167 return true;
1168}
1169
1171 if (name.empty())
1172 return CompilerType();
1173 return GetCompilerType(/*prefer_dynamic=*/false)
1175}
1176
1179}
1180
1182
1184 return m_decl.GetMangledName();
1185}
1186
1188
1190 return m_kind;
1191}
1192
1194 switch (m_kind) {
1196 return false;
1198 stream.Printf("constructor for %s",
1199 m_type.GetTypeName().AsCString("<unknown>"));
1200 break;
1202 stream.Printf("destructor for %s",
1203 m_type.GetTypeName().AsCString("<unknown>"));
1204 break;
1206 stream.Printf("instance method %s of type %s", m_name.AsCString(),
1208 break;
1210 stream.Printf("static method %s of type %s", m_name.AsCString(),
1212 break;
1213 }
1214 return true;
1215}
1216
1218 if (m_type)
1221}
1222
1224 if (m_type)
1226 else
1228}
1229
1231 if (m_type)
1233 else
1234 return m_decl.GetFunctionArgumentType(idx);
1235}
1236
1238 ConstString name,
1239 const llvm::APSInt &value)
1240 : m_integer_type_sp(integer_type_sp), m_name(name), m_value(value),
1241 m_valid((bool)name && (bool)integer_type_sp)
1242
1243{}
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:49
bool operator()(const lldb::TypeSP &type)
Definition: Type.cpp:228
TypeListImpl & m_type_list
Definition: Type.cpp:234
TypeAppendVisitor(TypeListImpl &type_list)
Definition: Type.cpp:226
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:1973
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:379
SymbolFileType(SymbolFile &symbol_file, lldb::user_id_t uid)
Definition: Type.h:366
lldb::TypeSP m_type_sp
Definition: Type.h:380
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:745
void SetName(ConstString type_name)
Definition: Type.cpp:866
bool operator!=(const TypeAndOrName &other) const
Definition: Type.cpp:854
bool operator==(const TypeAndOrName &other) const
Definition: Type.cpp:846
bool HasName() const
Definition: Type.cpp:901
ConstString GetName() const
Definition: Type.cpp:858
bool HasCompilerType() const
Definition: Type.cpp:903
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:886
ConstString m_type_name
Definition: Type.h:785
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:878
CompilerType m_compiler_type
Definition: Type.h:784
bool IsEmpty() const
Definition: Type.cpp:892
CompilerType GetCompilerType(bool prefer_dynamic)
Definition: Type.cpp:1130
bool operator!=(const TypeImpl &rhs) const
Definition: Type.cpp:999
bool CheckExeModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:961
bool GetDescription(lldb_private::Stream &strm, lldb::DescriptionLevel description_level)
Definition: Type.cpp:1154
bool operator==(const TypeImpl &rhs) const
Definition: Type.cpp:994
bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp, lldb::ModuleSP &module_sp) const
Definition: Type.cpp:965
TypeImpl GetCanonicalType() const
Definition: Type.cpp:1118
void SetType(const lldb::TypeSP &type_sp)
Definition: Type.cpp:928
TypeImpl GetUnqualifiedType() const
Definition: Type.cpp:1106
TypeImpl GetPointeeType() const
Definition: Type.cpp:1058
CompilerType m_dynamic_type
Definition: Type.h:660
CompilerType::TypeSystemSPWrapper GetTypeSystem(bool prefer_dynamic)
Definition: Type.cpp:1142
CompilerType m_static_type
Definition: Type.h:659
bool CheckModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:957
lldb::ModuleSP GetModule() const
Definition: Type.cpp:1019
TypeImpl GetDereferencedType() const
Definition: Type.cpp:1094
bool IsValid() const
Definition: Type.cpp:1003
TypeImpl GetPointerType() const
Definition: Type.cpp:1046
lldb::ModuleWP m_exe_module_wp
Definition: Type.h:658
TypeImpl GetReferenceType() const
Definition: Type.cpp:1070
TypeImpl GetTypedefedType() const
Definition: Type.cpp:1082
lldb::ModuleWP m_module_wp
Definition: Type.h:657
ConstString GetName() const
Definition: Type.cpp:1026
CompilerType FindDirectNestedType(llvm::StringRef name)
Definition: Type.cpp:1170
ConstString GetDisplayTypeName() const
Definition: Type.cpp:1036
void Append(const lldb::TypeImplSP &type)
Definition: Type.h:667
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:1217
ConstString GetMangledName() const
Definition: Type.cpp:1183
CompilerType GetType() const
Definition: Type.cpp:1187
ConstString GetName() const
Definition: Type.cpp:1181
CompilerType GetArgumentAtIndex(size_t idx) const
Definition: Type.cpp:1230
bool GetDescription(Stream &stream)
Definition: Type.cpp:1193
lldb::MemberFunctionKind GetKind() const
Definition: Type.cpp:1189
lldb::MemberFunctionKind m_kind
Definition: Type.h:822
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:296
void AddLanguage(lldb::LanguageType language)
Add a language family to the list of languages that should produce a match.
Definition: Type.cpp:118
TypeQueryOptions m_options
An options bitmask that contains enabled options for the type query.
Definition: Type.h:299
bool LanguageMatches(lldb::LanguageType language) const
Check if the language matches any languages that have been added to this match object.
Definition: Type.cpp:162
bool GetExactMatch() const
Definition: Type.h:264
bool GetIgnoreModules() 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:124
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:303
ConstString GetTypeBasename() const
Get the type basename to use when searching the type indexes in each SymbolFile object.
Definition: Type.cpp:112
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:128
bool GetFindOne() const
Returns true if the type query is supposed to find only a single matching type.
Definition: Type.h:277
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:173
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:360
bool Done(const TypeQuery &query) const
Check if the type matching has found all of the matches that it needs.
Definition: Type.cpp:179
bool AlreadySearched(lldb_private::SymbolFile *sym_file)
Check if a SymbolFile object has already been searched by this type match object.
Definition: Type.cpp:169
TypeMap m_type_map
Matching types get added to this map as type search continues.
Definition: Type.h:357
Type * m_encoding_type
Definition: Type.h:547
CompilerType m_compiler_type
Definition: Type.h:553
CompilerType GetForwardCompilerType()
Definition: Type.cpp:754
lldb::Format GetFormat()
Definition: Type.cpp:506
Declaration m_decl
Definition: Type.h:552
Type * GetEncodingType()
Definition: Type.cpp:432
ConstString GetName()
Definition: Type.cpp:420
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:556
uint64_t m_byte_size_has_value
Definition: Type.h:551
bool IsTemplateType()
Definition: Type.cpp:492
ResolveState m_compiler_type_resolve_state
Definition: Type.h:554
ConstString m_name
Definition: Type.h:543
uint32_t GetEncodingMask()
Definition: Type.cpp:735
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:284
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes)
Definition: Type.cpp:484
SymbolContextScope * m_context
The symbol context in which this type is defined.
Definition: Type.h:546
lldb::user_id_t m_encoding_uid
Definition: Type.h:548
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
Definition: Type.h:395
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
Definition: Type.h:392
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
Definition: Type.h:398
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
Definition: Type.h:408
@ eEncodingIsLLVMPtrAuthUID
This type is a signed pointer.
Definition: Type.h:412
@ eEncodingIsSyntheticUID
This type is the synthetic type whose UID is m_encoding_uid.
Definition: Type.h:410
@ eEncodingInvalid
Invalid encoding.
Definition: Type.h:387
@ eEncodingIsTypedefUID
This type is alias to a type whose UID is m_encoding_uid.
Definition: Type.h:400
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:402
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:404
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:406
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
Definition: Type.h:389
Payload m_payload
Language-specific flags.
Definition: Type.h:556
SymbolFile * GetSymbolFile()
Definition: Type.h:442
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:352
CompilerType GetLayoutCompilerType()
Definition: Type.cpp:749
lldb::Encoding GetEncoding(uint64_t &count)
Definition: Type.cpp:508
lldb::ModuleSP GetExeModule()
GetModule may return module for compile unit's object file.
Definition: Type.cpp:821
void DumpTypeName(Stream *s)
Definition: Type.cpp:430
static std::optional< ParsedName > GetTypeScopeAndBasename(llvm::StringRef name)
Definition: Type.cpp:764
lldb::TypeSP GetTypedefType()
Definition: Type.cpp:496
bool ResolveCompilerType(ResolveState compiler_type_resolve_state)
Definition: Type.cpp:558
SymbolFile * m_symbol_file
Definition: Type.h:544
bool IsAggregateType()
Definition: Type.cpp:488
EncodingDataType m_encoding_uid_type
Definition: Type.h:549
uint64_t m_byte_size
Definition: Type.h:550
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
Definition: Type.cpp:438
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:513
ConstString GetBaseName()
Definition: Type.cpp:426
ConstString GetQualifiedName()
Definition: Type.cpp:759
CompilerType GetFullCompilerType()
Definition: Type.cpp:744
lldb::ModuleSP GetModule()
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sur...
Definition: Type.cpp:815
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:551
bool IsTypedef()
Definition: Type.h:460
#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
@ AnyDeclContext
Math any declaration context.
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:185
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:509
lldb::TypeClass type_class
Definition: Type.h:505
llvm::StringRef basename
Definition: Type.h:511
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