39#include "clang/AST/CXXInheritance.h"
40#include "clang/AST/DeclCXX.h"
41#include "clang/AST/DeclObjC.h"
42#include "clang/AST/DeclTemplate.h"
43#include "clang/AST/Type.h"
44#include "llvm/Demangle/Demangle.h"
53#ifdef ENABLE_DEBUG_PRINTF
55#define DEBUG_PRINTF(fmt, ...) printf(fmt, __VA_ARGS__)
57#define DEBUG_PRINTF(fmt, ...)
64 : m_ast(ast), m_die_to_decl_ctx(), m_decl_ctx_to_die() {}
70 case clang::Decl::CXXRecord:
71 case clang::Decl::ClassTemplateSpecialization:
92 while (Parent.IsValid()) {
93 if (Parent.Tag() == DW_TAG_module)
106 parent = parent.GetParent()) {
108 if (tag == DW_TAG_module)
109 top_module_die = parent;
110 else if (tag == DW_TAG_compile_unit || tag == DW_TAG_partial_unit)
114 return top_module_die;
123 if (clang_module_die) {
124 const char *module_name = clang_module_die.
GetName();
130 return lldb::ModuleSP();
137 if (!clang_module_sp)
143 llvm::SmallVector<CompilerContext, 4> decl_context;
150 llvm::DenseSet<SymbolFile *> searched_symbol_files;
151 clang_module_sp->GetSymbolFile()->FindTypes(decl_context, languages,
152 searched_symbol_files, pcm_types);
153 if (pcm_types.
Empty()) {
162 searched_symbol_files.insert(&sym_file);
165 module.GetSymbolFile()->FindTypes(decl_context, languages,
166 searched_symbol_files, pcm_types);
167 return pcm_types.GetSize();
201 auto type_sp =
dwarf->MakeType(
202 die.
GetID(), pcm_type_sp->GetName(), pcm_type_sp->GetByteSize(
nullptr),
204 &pcm_type_sp->GetDeclaration(), type, Type::ResolveState::Forward,
206 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
221 lldbassert(started &&
"Unable to start a class type definition.");
235 clang::DeclContext *decl_ctx,
237 const char *type_name_cstr) {
238 auto *tag_decl_ctx = clang::dyn_cast<clang::TagDecl>(decl_ctx);
244 if (tag_decl_ctx->isCompleteDefinition() || tag_decl_ctx->isBeingDefined())
253 if (type && ast_importer.
CanImport(type)) {
258 "Unable to complete the Decl context for DIE {0} at offset "
259 "{1:x16}.\nPlease file a bug report.",
260 type_name_cstr ? type_name_cstr :
"", die.
GetOffset());
271 for (
size_t i = 0; i < num_attributes; ++i) {
277 case DW_AT_abstract_origin:
281 case DW_AT_accessibility:
285 case DW_AT_artificial:
289 case DW_AT_bit_stride:
293 case DW_AT_byte_size:
297 case DW_AT_byte_stride:
301 case DW_AT_calling_convention:
305 case DW_AT_containing_type:
309 case DW_AT_decl_file:
314 case DW_AT_decl_line:
317 case DW_AT_decl_column:
321 case DW_AT_declaration:
329 case DW_AT_enum_class:
346 case DW_AT_linkage_name:
347 case DW_AT_MIPS_linkage_name:
355 case DW_AT_object_pointer:
359 case DW_AT_signature:
363 case DW_AT_specification:
371 case DW_AT_virtuality:
375 case DW_AT_APPLE_objc_complete_type:
379 case DW_AT_APPLE_objc_direct:
383 case DW_AT_APPLE_runtime_class:
387 case DW_AT_GNU_vector:
390 case DW_AT_export_symbols:
393 case DW_AT_rvalue_reference:
396 case DW_AT_reference:
405 return unit->GetAbsolutePath().GetPath();
406 return "<missing DWARF unit path>";
411 bool *type_is_new_ptr) {
413 *type_is_new_ptr =
false;
418 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
423 clang::DeclContext *context =
426 dwarf->GetObjectFile()->GetModule()->LogMessage(
428 "DWARFASTParserClang::ParseTypeFromDWARF "
429 "(die = {0:x16}, decl_ctx = {1:p} (die "
430 "{2:x16})) {3} name = '{4}')",
439 return type_ptr->shared_from_this();
448 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
449 if (clang::DeclContext *decl_ctx =
458 *type_is_new_ptr =
true;
466 case DW_TAG_base_type:
467 case DW_TAG_pointer_type:
468 case DW_TAG_reference_type:
469 case DW_TAG_rvalue_reference_type:
470 case DW_TAG_const_type:
471 case DW_TAG_restrict_type:
472 case DW_TAG_volatile_type:
473 case DW_TAG_atomic_type:
474 case DW_TAG_unspecified_type: {
479 case DW_TAG_structure_type:
480 case DW_TAG_union_type:
481 case DW_TAG_class_type: {
486 case DW_TAG_enumeration_type: {
491 case DW_TAG_inlined_subroutine:
492 case DW_TAG_subprogram:
493 case DW_TAG_subroutine_type: {
497 case DW_TAG_array_type: {
501 case DW_TAG_ptr_to_member_type: {
506 dwarf->GetObjectFile()->GetModule()->ReportError(
507 "[{0:x16}]: unhandled type tag {1:x4} ({2}), "
508 "please file a bug and "
509 "attach the file at the start of this error message",
524 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
533 if (tag == DW_TAG_typedef) {
583 encoding_uid.Reference());
589 case DW_TAG_unspecified_type:
590 if (attrs.
name ==
"nullptr_t" || attrs.
name ==
"decltype(nullptr)") {
591 resolve_state = Type::ResolveState::Full;
599 case DW_TAG_base_type:
600 resolve_state = Type::ResolveState::Full;
606 case DW_TAG_pointer_type:
609 case DW_TAG_reference_type:
612 case DW_TAG_rvalue_reference_type:
618 case DW_TAG_const_type:
621 case DW_TAG_restrict_type:
624 case DW_TAG_volatile_type:
627 case DW_TAG_atomic_type:
634 if (tag == DW_TAG_pointer_type) {
642 if (!strcmp(child_die.GetAttributeValueAsString(DW_AT_name,
""),
647 if (function_pointer_type) {
651 bool function_type_is_new_pointer;
653 sc, function_type, &function_type_is_new_pointer);
655 if (lldb_function_type_sp) {
657 lldb_function_type_sp->GetForwardCompilerType());
660 resolve_state = Type::ResolveState::Full;
673 if (attrs.
name ==
"id") {
675 dwarf->GetObjectFile()->GetModule()->LogMessage(
677 "SymbolFileDWARF::ParseType (die = {0:x16}) {1} '{2}' "
678 "is Objective-C 'id' built-in type.",
683 resolve_state = Type::ResolveState::Full;
684 }
else if (attrs.
name ==
"Class") {
686 dwarf->GetObjectFile()->GetModule()->LogMessage(
688 "SymbolFileDWARF::ParseType (die = {0:x16}) {1} '{2}' "
689 "is Objective-C 'Class' built-in type.",
694 resolve_state = Type::ResolveState::Full;
695 }
else if (attrs.
name ==
"SEL") {
697 dwarf->GetObjectFile()->GetModule()->LogMessage(
699 "SymbolFileDWARF::ParseType (die = {0:x16}) {1} '{2}' "
700 "is Objective-C 'selector' built-in type.",
705 resolve_state = Type::ResolveState::Full;
714 if (encoding_die && encoding_die.
Tag() == DW_TAG_structure_type) {
715 llvm::StringRef struct_name = encoding_die.
GetName();
716 if (struct_name ==
"objc_object") {
718 dwarf->GetObjectFile()->GetModule()->LogMessage(
720 "SymbolFileDWARF::ParseType (die = {0:x16}) {1} "
721 "'{2}' is 'objc_object*', which we overrode to "
727 resolve_state = Type::ResolveState::Full;
734 type_sp =
dwarf->MakeType(
739 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
745 if (llvm::StringRef(die.
GetName()).contains(
"<"))
758 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
768 type_sp =
dwarf->FindDefinitionTypeForDWARFDeclContext(die);
772 if (debug_map_symfile) {
781 dwarf->GetObjectFile()->GetModule()->LogMessage(
783 "SymbolFileDWARF({0:p}) - {1:x16}}: {2} type \"{3}\" is a "
784 "forward declaration, complete type is {4:x8}",
785 static_cast<void *
>(
this), die.
GetOffset(),
793 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
794 clang::DeclContext *defn_decl_ctx =
808 dwarf->GetForwardDeclDieToClangType().lookup(die.
GetDIE()));
811 Type *enumerator_type =
817 if (!enumerator_clang_type) {
820 "", DW_ATE_signed, *attrs.
byte_size * 8);
840 Type::ResolveState::Forward,
845 bool is_signed =
false;
852 dwarf->GetObjectFile()->GetModule()->ReportError(
853 "DWARF DIE at {0:x16} named \"{1}\" was not able to start its "
854 "definition.\nPlease file a bug and attach the file at the "
855 "start of this error message",
861static clang::CallingConv
864 case llvm::dwarf::DW_CC_normal:
866 case llvm::dwarf::DW_CC_BORLAND_stdcall:
867 return clang::CC_X86StdCall;
868 case llvm::dwarf::DW_CC_BORLAND_msfastcall:
869 return clang::CC_X86FastCall;
870 case llvm::dwarf::DW_CC_LLVM_vectorcall:
871 return clang::CC_X86VectorCall;
872 case llvm::dwarf::DW_CC_BORLAND_pascal:
873 return clang::CC_X86Pascal;
874 case llvm::dwarf::DW_CC_LLVM_Win64:
875 return clang::CC_Win64;
876 case llvm::dwarf::DW_CC_LLVM_X86_64SysV:
877 return clang::CC_X86_64SysV;
878 case llvm::dwarf::DW_CC_LLVM_X86RegCall:
879 return clang::CC_X86RegCall;
884 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
885 LLDB_LOG(log,
"Unsupported DW_AT_calling_convention value: {0}",
893 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
898 bool is_variadic =
false;
899 bool is_static =
false;
900 bool has_template_params =
false;
902 unsigned type_quals = 0;
904 std::string object_pointer_name;
907 if (object_pointer_name_cstr)
908 object_pointer_name = object_pointer_name_cstr;
915 Type *func_type =
nullptr;
925 std::vector<CompilerType> function_param_types;
926 std::vector<clang::ParmVarDecl *> function_param_decls;
931 clang::DeclContext *containing_decl_ctx =
933 const clang::Decl::Kind containing_decl_kind =
934 containing_decl_ctx->getDeclKind();
945 bool skip_artificial =
true;
947 is_variadic, has_template_params,
948 function_param_types, function_param_decls,
952 bool ignore_containing_context =
false;
963 if (is_cxx_method && has_template_params) {
964 ignore_containing_context =
true;
965 is_cxx_method =
false;
968 clang::CallingConv calling_convention =
975 function_param_types.size(), is_variadic,
976 type_quals, calling_convention, attrs.
ref_qual);
979 bool type_handled =
false;
980 if (tag == DW_TAG_subprogram || tag == DW_TAG_inlined_subroutine) {
982 if (objc_method.
IsValid(
true)) {
986 TypeSP complete_objc_class_type_sp(
990 if (complete_objc_class_type_sp) {
992 complete_objc_class_type_sp->GetForwardCompilerType();
994 type_clang_forward_type))
995 class_opaque_type = type_clang_forward_type;
999 if (class_opaque_type) {
1005 clang::ObjCMethodDecl *objc_method_decl =
1010 type_handled = objc_method_decl !=
nullptr;
1015 dwarf->GetObjectFile()->GetModule()->ReportError(
1016 "[{0:x16}]: invalid Objective-C method {1:x4} ({2}), "
1017 "please file a bug and attach the file at the start of "
1018 "this error message",
1022 }
else if (is_cxx_method) {
1025 Type *class_type =
dwarf->ResolveType(decl_ctx_die);
1027 if (class_type->
GetID() != decl_ctx_die.
GetID() ||
1035 if (class_type_die) {
1036 std::vector<DWARFDIE> failures;
1039 class_type, failures);
1048 return type_ptr->shared_from_this();
1063 clang::DeclContext *spec_clang_decl_ctx =
1065 if (spec_clang_decl_ctx) {
1068 dwarf->GetObjectFile()->GetModule()->ReportWarning(
1069 "{0:x8}: DW_AT_specification({1:x16}"
1073 type_handled =
true;
1082 clang::DeclContext *abs_clang_decl_ctx =
1084 if (abs_clang_decl_ctx) {
1087 dwarf->GetObjectFile()->GetModule()->ReportWarning(
1088 "{0:x8}: DW_AT_abstract_origin({1:x16}"
1092 type_handled =
true;
1103 type_handled =
true;
1105 llvm::PrettyStackTraceFormat stack_trace(
1106 "SymbolFileDWARF::ParseType() is adding a method "
1107 "%s to class %s in DIE 0x%8.8" PRIx64
" from %s",
1110 dwarf->GetObjectFile()->GetFileSpec().GetPath().c_str());
1112 const bool is_attr_used =
false;
1119 clang::CXXMethodDecl *cxx_method_decl =
1127 type_handled = cxx_method_decl !=
nullptr;
1132 if (cxx_method_decl) {
1138 if (!object_pointer_name.empty()) {
1141 "Setting object pointer name: %s on method "
1143 object_pointer_name.c_str(),
1144 static_cast<void *
>(cxx_method_decl));
1148 ignore_containing_context =
true;
1174 return type_ptr->shared_from_this();
1181 type_handled =
true;
1189 if (!type_handled) {
1190 clang::FunctionDecl *function_decl =
nullptr;
1191 clang::FunctionDecl *template_function_decl =
nullptr;
1196 if (
dwarf->ResolveType(abs_die)) {
1197 function_decl = llvm::dyn_cast_or_null<clang::FunctionDecl>(
1200 if (function_decl) {
1206 if (!function_decl) {
1207 char *name_buf =
nullptr;
1214 llvm::ItaniumPartialDemangler D;
1216 name_buf = D.getFunctionBaseName(
nullptr,
nullptr);
1224 : containing_decl_ctx,
1227 std::free(name_buf);
1229 if (has_template_params) {
1234 : containing_decl_ctx,
1237 clang::FunctionTemplateDecl *func_template_decl =
1240 template_function_decl, template_param_infos);
1242 template_function_decl, func_template_decl, template_param_infos);
1247 if (function_decl) {
1259 function_decl->addAttr(clang::AsmLabelAttr::CreateImplicit(
1264 if (!function_param_decls.empty()) {
1266 if (template_function_decl)
1268 function_param_decls);
1274 if (!object_pointer_name.empty()) {
1277 "Setting object pointer name: %s on function "
1279 object_pointer_name.c_str(),
1280 static_cast<void *
>(function_decl));
1287 return dwarf->MakeType(
1301 Type *element_type =
dwarf->ResolveTypeUID(type_die,
true);
1310 byte_stride = array_info->byte_stride;
1311 bit_stride = array_info->bit_stride;
1313 if (byte_stride == 0 && bit_stride == 0)
1314 byte_stride = element_type->
GetByteSize(
nullptr).value_or(0);
1318 uint64_t array_element_bit_stride = byte_stride * 8 + bit_stride;
1320 if (array_info && array_info->element_orders.size() > 0) {
1321 uint64_t num_elements = 0;
1322 auto end = array_info->element_orders.rend();
1323 for (
auto pos = array_info->element_orders.rbegin(); pos != end; ++pos) {
1324 num_elements = *pos;
1327 array_element_type = clang_type;
1328 array_element_bit_stride = num_elements
1329 ? array_element_bit_stride * num_elements
1330 : array_element_bit_stride;
1338 dwarf->MakeType(die.
GetID(), empty_name, array_element_bit_stride / 8,
1340 &attrs.
decl, clang_type, Type::ResolveState::Full);
1341 type_sp->SetEncodingType(element_type);
1358 class_clang_type, pointee_clang_type);
1360 if (std::optional<uint64_t> clang_type_size =
1362 return dwarf->MakeType(die.
GetID(), attrs.
name, *clang_type_size,
nullptr,
1364 clang_type, Type::ResolveState::Forward);
1372 const lldb::ModuleSP &module_sp,
1373 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
1382 const size_t num_attributes = die.
GetAttributes(attributes);
1383 if (num_attributes == 0)
1387 AccessType accessibility = default_accessibility;
1388 bool is_virtual =
false;
1389 bool is_base_of_class =
true;
1390 off_t member_byte_offset = 0;
1392 for (
uint32_t i = 0; i < num_attributes; ++i) {
1398 encoding_form = form_value;
1400 case DW_AT_data_member_location:
1402 Value initialValue(0);
1403 Value memberOffset(0);
1409 nullptr,
nullptr, module_sp,
1412 memberOffset,
nullptr)) {
1419 member_byte_offset = form_value.
Unsigned();
1423 case DW_AT_accessibility:
1427 case DW_AT_virtuality:
1428 is_virtual = form_value.
Boolean();
1438 if (base_class_type ==
nullptr) {
1439 module_sp->ReportError(
"{0:x16}: DW_TAG_inheritance failed to "
1440 "resolve the base class at {1:x16}"
1441 " from enclosing type {2:x16}. \nPlease file "
1442 "a bug and attach the file at the start of "
1443 "this error message",
1451 assert(base_class_clang_type);
1453 ast->SetObjCSuperClass(class_clang_type, base_class_clang_type);
1456 std::unique_ptr<clang::CXXBaseSpecifier> result =
1458 accessibility, is_virtual,
1463 base_classes.push_back(std::move(result));
1481 clang::CharUnits::fromQuantity(member_byte_offset)));
1495 if (sc_parent_tag == DW_TAG_compile_unit ||
1496 sc_parent_tag == DW_TAG_partial_unit) {
1498 }
else if (sc.
function !=
nullptr && sc_parent_die) {
1499 symbol_context_scope =
1501 if (symbol_context_scope ==
nullptr)
1502 symbol_context_scope = sc.
function;
1504 symbol_context_scope = sc.
module_sp.get();
1507 if (symbol_context_scope !=
nullptr)
1508 type_sp->SetSymbolContextScope(symbol_context_scope);
1510 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
1518 const char *name = die.
GetName();
1521 std::string qualified_name;
1524 while (parent_decl_ctx_die) {
1528 const dw_tag_t parent_tag = parent_decl_ctx_die.
Tag();
1529 switch (parent_tag) {
1530 case DW_TAG_namespace: {
1531 if (
const char *namespace_name = parent_decl_ctx_die.
GetName()) {
1532 qualified_name.insert(0,
"::");
1533 qualified_name.insert(0, namespace_name);
1535 qualified_name.insert(0,
"(anonymous namespace)::");
1541 case DW_TAG_class_type:
1542 case DW_TAG_structure_type:
1543 case DW_TAG_union_type: {
1544 if (
const char *class_union_struct_name = parent_decl_ctx_die.
GetName()) {
1545 qualified_name.insert(
1547 qualified_name.insert(0,
"::");
1548 qualified_name.insert(0, class_union_struct_name);
1555 parent_decl_ctx_die.
Clear();
1560 if (qualified_name.empty())
1561 qualified_name.append(
"::");
1563 qualified_name.append(name);
1566 return qualified_name;
1578 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
1584 auto unique_ast_entry_up = std::make_unique<UniqueDWARFASTType>();
1595 if (!qualified_name.empty())
1597 unique_decl.
Clear();
1600 if (
dwarf->GetUniqueDWARFASTTypeMap().Find(
1601 unique_typename, die, unique_decl, attrs.
byte_size.value_or(-1),
1602 *unique_ast_entry_up)) {
1603 type_sp = unique_ast_entry_up->m_type_sp;
1605 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
1616 int tag_decl_kind = -1;
1618 if (tag == DW_TAG_structure_type) {
1619 tag_decl_kind = clang::TTK_Struct;
1621 }
else if (tag == DW_TAG_union_type) {
1622 tag_decl_kind = clang::TTK_Union;
1624 }
else if (tag == DW_TAG_class_type) {
1625 tag_decl_kind = clang::TTK_Class;
1654 dwarf->FindCompleteObjCDefinitionTypeForDIE(die, attrs.
name,
true);
1658 dwarf->GetDebugMapSymfile();
1659 if (debug_map_symfile) {
1663 die, attrs.
name,
true);
1669 dwarf->GetObjectFile()->GetModule()->LogMessage(
1671 "SymbolFileDWARF({0:p}) - {1:x16}: {2} type "
1673 "incomplete objc type, complete type is {4:x8}",
1674 static_cast<void *
>(
this), die.
GetOffset(),
1682 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
1695 dwarf->GetObjectFile()->GetModule()->LogMessage(
1697 "SymbolFileDWARF({0:p}) - {1:x16}: {2} type \"{3}\" is a "
1698 "forward declaration, trying to find complete type",
1711 type_sp =
dwarf->FindDefinitionTypeForDWARFDeclContext(die);
1715 if (debug_map_symfile) {
1724 dwarf->GetObjectFile()->GetModule()->LogMessage(
1726 "SymbolFileDWARF({0:p}) - {1:x16}: {2} type \"{3}\" is a "
1727 "forward declaration, complete type is {4:x8}",
1728 static_cast<void *
>(
this), die.
GetOffset(),
1735 dwarf->GetDIEToType()[die.
GetDIE()] = type_sp.get();
1736 clang::DeclContext *defn_decl_ctx =
1743 assert(tag_decl_kind != -1);
1744 (void)tag_decl_kind;
1745 bool clang_type_was_created =
false;
1748 dwarf->GetForwardDeclDieToClangType().lookup(die.
GetDIE()));
1750 clang::DeclContext *decl_ctx =
1759 const clang::Decl::Kind containing_decl_kind = decl_ctx->getDeclKind();
1770 clang::ClassTemplateDecl *class_template_decl =
1774 if (!class_template_decl) {
1776 dwarf->GetObjectFile()->GetModule()->LogMessage(
1778 "SymbolFileDWARF({0:p}) - {1:x16}: {2} type \"{3}\" "
1779 "clang::ClassTemplateDecl failed to return a decl.",
1780 static_cast<void *
>(
this), die.
GetOffset(),
1786 clang::ClassTemplateSpecializationDecl *class_specialization_decl =
1789 tag_decl_kind, template_param_infos);
1791 class_specialization_decl);
1792 clang_type_was_created =
true;
1798 if (!clang_type_was_created) {
1799 clang_type_was_created =
true;
1811 type_sp =
dwarf->MakeType(
1814 Type::ResolveState::Forward,
1820 unique_ast_entry_up->m_type_sp = type_sp;
1821 unique_ast_entry_up->m_die = die;
1822 unique_ast_entry_up->m_declaration = unique_decl;
1823 unique_ast_entry_up->m_byte_size = attrs.
byte_size.value_or(0);
1824 dwarf->GetUniqueDWARFASTTypeMap().Insert(unique_typename,
1825 *unique_ast_entry_up);
1837 dwarf->GetObjectFile()->GetModule()->ReportError(
1839 "DWARF DIE at {0:x16} named \"{1}\" was not able to start "
1841 "definition.\nPlease file a bug and attach the file at the "
1842 "start of this error message",
1852 clang::RecordDecl *record_decl =
1860 }
else if (clang_type_was_created) {
1878 assert(!
dwarf->GetForwardDeclClangTypeToDie().count(
1881 "Type already in the forward declaration map!");
1885 dwarf->GetForwardDeclDieToClangType()[die.
GetDIE()] =
1887 dwarf->GetForwardDeclClangTypeToDie().try_emplace(
1899 clang::CXXRecordDecl *record_decl =
1901 if (record_decl && record_decl->getDefinition()) {
1902 record_decl->setHasTrivialSpecialMemberForCall();
1907 clang::CXXRecordDecl *record_decl =
1910 record_decl->setArgPassingRestrictions(
1911 clang::RecordDecl::APK_CannotPassInRegs);
1921 const CompilerType &class_opaque_type,
const char *property_name,
1925 const char *property_setter_name,
const char *property_getter_name,
1932 if (metadata !=
nullptr) {
1979 bool is_template_template_argument =
false;
1982 case DW_TAG_GNU_template_parameter_pack: {
1984 std::make_unique<TypeSystemClang::TemplateParameterInfos>());
1989 if (
const char *name = die.
GetName()) {
1994 case DW_TAG_GNU_template_template_param:
1995 is_template_template_argument =
true;
1997 case DW_TAG_template_type_parameter:
1998 case DW_TAG_template_value_parameter: {
2000 const size_t num_attributes = die.
GetAttributes(attributes);
2001 const char *name =
nullptr;
2002 const char *template_name =
nullptr;
2004 uint64_t uval64 = 0;
2005 bool uval64_valid =
false;
2006 bool is_default_template_arg =
false;
2007 if (num_attributes > 0) {
2009 for (
size_t i = 0; i < num_attributes; ++i) {
2018 case DW_AT_GNU_template_name:
2031 case DW_AT_const_value:
2033 uval64_valid =
true;
2037 case DW_AT_default_value:
2039 is_default_template_arg = form_value.
Boolean();
2050 if (!is_template_template_argument) {
2051 bool is_signed =
false;
2055 if (name && !name[0])
2058 if (tag == DW_TAG_template_value_parameter && uval64_valid) {
2059 std::optional<uint64_t> size = clang_type.
GetBitSize(
nullptr);
2062 llvm::APInt apint(*size, uval64, is_signed);
2065 clang::TemplateArgument(ast, llvm::APSInt(apint, !is_signed),
2067 is_default_template_arg));
2072 is_default_template_arg));
2077 name, clang::TemplateArgument(clang::TemplateName(tplt_type),
2078 is_default_template_arg));
2101 case DW_TAG_template_type_parameter:
2102 case DW_TAG_template_value_parameter:
2103 case DW_TAG_GNU_template_parameter_pack:
2104 case DW_TAG_GNU_template_template_param:
2113 return !template_param_infos.
IsEmpty() ||
2126 const bool type_is_objc_object_or_interface =
2128 if (type_is_objc_object_or_interface) {
2135 if (tag == DW_TAG_structure_type) {
2137 }
else if (tag == DW_TAG_union_type) {
2139 }
else if (tag == DW_TAG_class_type) {
2143 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> bases;
2145 std::vector<DWARFDIE> member_function_dies;
2149 delayed_properties, default_accessibility, layout_info);
2152 for (
const DWARFDIE &die : member_function_dies)
2153 dwarf->ResolveType(die);
2155 if (type_is_objc_object_or_interface) {
2158 dwarf->GetObjCMethods(class_name, [&](
DWARFDIE method_die) {
2164 property.Finalize();
2168 if (!bases.empty()) {
2172 for (
const auto &base_class : bases) {
2173 clang::TypeSourceInfo *type_source_info =
2174 base_class->getTypeSourceInfo();
2175 if (type_source_info)
2197 clang::CXXRecordDecl *record_decl =
2203 return (
bool)clang_type;
2211 bool is_signed =
false;
2218 return (
bool)clang_type;
2226 std::lock_guard<std::recursive_mutex> guard(
2227 dwarf->GetObjectFile()->GetModule()->GetMutex());
2241 case DW_TAG_structure_type:
2242 case DW_TAG_union_type:
2243 case DW_TAG_class_type:
2245 case DW_TAG_enumeration_type:
2248 assert(
false &&
"not a forward clang type decl!");
2257 auto opaque_decl_ctx =
2268 if (clang_decl !=
nullptr)
2283 clang::DeclContext *clang_decl_ctx =
2296 size_t enumerators_added = 0;
2300 if (tag == DW_TAG_enumerator) {
2302 const size_t num_child_attributes = die.GetAttributes(attributes);
2303 if (num_child_attributes > 0) {
2304 const char *name =
nullptr;
2305 bool got_value =
false;
2306 int64_t enum_value = 0;
2310 for (i = 0; i < num_child_attributes; ++i) {
2315 case DW_AT_const_value:
2318 enum_value = form_value.
Signed();
2320 enum_value = form_value.
Unsigned();
2327 case DW_AT_description:
2329 case DW_AT_decl_file:
2333 case DW_AT_decl_line:
2336 case DW_AT_decl_column:
2345 if (name && name[0] && got_value) {
2347 clang_type, decl, name, enum_value, enumerator_byte_size * 8);
2348 ++enumerators_added;
2353 return enumerators_added;
2358 bool is_static =
false;
2359 bool is_variadic =
false;
2360 bool has_template_params =
false;
2361 unsigned type_quals = 0;
2362 std::vector<CompilerType> param_types;
2363 std::vector<clang::ParmVarDecl *> param_decls;
2369 clang::DeclContext *containing_decl_ctx =
2372 has_template_params, param_types, param_decls,
2375 for (
size_t i = 0; i < param_types.size(); i++) {
2378 sstr << param_types[i].GetTypeName();
2383 if (type_quals & clang::Qualifiers::Const)
2395 const char *name =
nullptr;
2396 const char *mangled =
nullptr;
2399 int decl_column = 0;
2402 int call_column = 0;
2407 if (tag != DW_TAG_subprogram)
2411 decl_column, call_file, call_line, call_column,
2416 else if ((die.
GetParent().
Tag() == DW_TAG_compile_unit ||
2422 name && strcmp(name,
"main") != 0) {
2431 std::unique_ptr<Declaration> decl_up;
2432 if (decl_file != 0 || decl_line != 0 || decl_column != 0)
2433 decl_up = std::make_unique<Declaration>(die.
GetCU()->
GetFile(decl_file),
2434 decl_line, decl_column);
2444 std::make_shared<Function>(&comp_unit,
2446 func_user_id, func_name, func_type,
2449 if (func_sp.get() !=
nullptr) {
2451 func_sp->GetFrameBaseExpression() = frame_base;
2453 return func_sp.get();
2461struct MemberAttributes {
2463 ModuleSP module_sp);
2464 const char *name =
nullptr;
2467 int64_t bit_offset = 0;
2469 size_t bit_size = 0;
2472 std::optional<uint64_t> byte_size;
2473 std::optional<DWARFFormValue> const_value_form;
2478 bool is_artificial =
false;
2483struct PropertyAttributes {
2484 explicit PropertyAttributes(
const DWARFDIE &die);
2485 const char *prop_name =
nullptr;
2486 const char *prop_getter_name =
nullptr;
2487 const char *prop_setter_name =
nullptr;
2493MemberAttributes::MemberAttributes(
const DWARFDIE &die,
2495 ModuleSP module_sp) {
2496 member_byte_offset = (parent_die.
Tag() == DW_TAG_union_type) ? 0 :
UINT32_MAX;
2499 const size_t num_attributes = die.
GetAttributes(attributes);
2500 for (std::size_t i = 0; i < num_attributes; ++i) {
2509 encoding_form = form_value;
2511 case DW_AT_bit_offset:
2512 bit_offset = form_value.
Signed();
2514 case DW_AT_bit_size:
2517 case DW_AT_byte_size:
2520 case DW_AT_const_value:
2521 const_value_form = form_value;
2523 case DW_AT_data_bit_offset:
2524 data_bit_offset = form_value.
Unsigned();
2526 case DW_AT_data_member_location:
2528 Value initialValue(0);
2529 Value memberOffset(0);
2540 memberOffset,
nullptr)) {
2541 member_byte_offset = memberOffset.ResolveValue(
nullptr).UInt();
2547 member_byte_offset = form_value.
Unsigned();
2551 case DW_AT_accessibility:
2554 case DW_AT_artificial:
2555 is_artificial = form_value.
Boolean();
2575 if (byte_size.value_or(0) == 0 && bit_offset < 0) {
2581PropertyAttributes::PropertyAttributes(
const DWARFDIE &die) {
2584 const size_t num_attributes = die.
GetAttributes(attributes);
2585 for (
size_t i = 0; i < num_attributes; ++i) {
2590 case DW_AT_APPLE_property_name:
2593 case DW_AT_APPLE_property_getter:
2594 prop_getter_name = form_value.
AsCString();
2596 case DW_AT_APPLE_property_setter:
2597 prop_setter_name = form_value.
AsCString();
2599 case DW_AT_APPLE_property_attribute:
2600 prop_attributes = form_value.
Unsigned();
2614 if (prop_getter_name && prop_getter_name[0] ==
'-') {
2616 prop_getter_name = prop_getter_method.GetSelector().GetCString();
2619 if (prop_setter_name && prop_setter_name[0] ==
'-') {
2621 prop_setter_name = prop_setter_method.GetSelector().GetCString();
2625 if (!prop_getter_name)
2626 prop_getter_name = prop_name;
2627 if (!prop_setter_name && prop_name[0] &&
2628 !(prop_attributes & DW_APPLE_PROPERTY_readonly)) {
2631 ss.
Printf(
"set%c%s:", toupper(prop_name[0]), &prop_name[1]);
2634 prop_setter_name = fixed_setter.
GetCString();
2643 assert(die.
Tag() == DW_TAG_APPLE_property);
2647 const MemberAttributes attrs(die, parent_die, module_sp);
2648 const PropertyAttributes propAttrs(die);
2650 if (!propAttrs.prop_name) {
2651 module_sp->ReportError(
"{0:x8}: DW_TAG_APPLE_property has no name.",
2658 module_sp->ReportError(
2659 "{0:x8}: DW_TAG_APPLE_property '{1}' refers to type {2:x16}"
2660 " which was unable to be parsed",
2661 die.
GetID(), propAttrs.prop_name,
2662 attrs.encoding_form.Reference().GetOffset());
2669 class_clang_type, propAttrs.prop_name,
2671 propAttrs.prop_getter_name, propAttrs.prop_attributes, &metadata));
2677 assert(qt->isIntegralOrEnumerationType());
2680 return llvm::createStringError(llvm::inconvertibleErrorCode(),
2681 "TypeSystem not clang");
2685 const unsigned type_bits = ast.getIntWidth(qt);
2686 const bool is_unsigned = qt->isUnsignedIntegerType();
2690 constexpr std::size_t max_bit_size = 64;
2695 if (type_bits > max_bit_size) {
2696 auto msg = llvm::formatv(
"Can only parse integers with up to {0} bits, but "
2697 "given integer has {1} bits.",
2698 max_bit_size, type_bits);
2699 return llvm::createStringError(llvm::inconvertibleErrorCode(), msg.str());
2703 llvm::APInt result(max_bit_size, form_value.
Unsigned(), !is_unsigned);
2709 const unsigned required_bits =
2710 is_unsigned ? result.getActiveBits() : result.getMinSignedBits();
2713 if (required_bits > type_bits) {
2714 std::string value_as_str = is_unsigned
2715 ? std::to_string(form_value.
Unsigned())
2716 : std::to_string(form_value.
Signed());
2717 auto msg = llvm::formatv(
"Can't store {0} value {1} in integer with {2} "
2719 (is_unsigned ?
"unsigned" :
"signed"),
2720 value_as_str, type_bits);
2721 return llvm::createStringError(llvm::inconvertibleErrorCode(), msg.str());
2725 if (result.getBitWidth() > type_bits)
2726 result = result.trunc(type_bits);
2736 Log *log =
GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
2738 assert(die.
Tag() == DW_TAG_member);
2743 const uint64_t parent_byte_size =
2745 const uint64_t parent_bit_size =
2749 MemberAttributes attrs(die, parent_die, module_sp);
2751 const bool class_is_objc_object_or_interface =
2755 if (class_is_objc_object_or_interface)
2760 if (attrs.member_byte_offset ==
UINT32_MAX &&
2769 class_clang_type, attrs.name, ct, attrs.accessibility);
2771 LLDB_LOG(log,
"Failed to add variable to the record type");
2780 llvm::Expected<llvm::APInt> const_value_or_err =
2782 if (!const_value_or_err) {
2784 "Failed to add const value to variable {1}: {0}",
2785 v->getQualifiedNameAsString());
2797 module_sp->ReportError(
2798 "{0:x8}: DW_TAG_member '{1}' refers to type {2:x16}"
2799 " which was unable to be parsed",
2800 die.
GetID(), attrs.name, attrs.encoding_form.Reference().GetOffset());
2802 module_sp->ReportError(
"{0:x8}: DW_TAG_member refers to type {1:x16}"
2803 " which was unable to be parsed",
2805 attrs.encoding_form.Reference().GetOffset());
2809 const uint64_t character_width = 8;
2810 const uint64_t word_width = 32;
2814 attrs.accessibility = default_accessibility;
2816 uint64_t field_bit_offset = (attrs.member_byte_offset ==
UINT32_MAX
2818 : (attrs.member_byte_offset * 8ULL));
2820 if (attrs.bit_size > 0) {
2822 this_field_info.
bit_offset = field_bit_offset;
2823 this_field_info.
bit_size = attrs.bit_size;
2826 this_field_info.
bit_offset = attrs.data_bit_offset;
2828 if (!attrs.byte_size)
2829 attrs.byte_size = member_type->
GetByteSize(
nullptr);
2833 this_field_info.
bit_offset += attrs.byte_size.value_or(0) * 8;
2834 this_field_info.
bit_offset -= (attrs.bit_offset + attrs.bit_size);
2836 this_field_info.
bit_offset += attrs.bit_offset;
2847 !(parent_die.
Tag() == DW_TAG_union_type &&
2849 ((this_field_info.
bit_offset >= parent_bit_size) ||
2855 "{0:x16}: {1} bitfield named \"{2}\" has invalid "
2856 "bit offset ({3:x8}) member will be ignored. Please file a bug "
2858 "compiler and include the preprocessed output for {4}\n",
2865 field_bit_offset = this_field_info.
bit_offset;
2870 bool detect_unnamed_bitfields =
true;
2872 if (class_is_objc_object_or_interface)
2873 detect_unnamed_bitfields =
2876 if (detect_unnamed_bitfields) {
2877 std::optional<FieldInfo> unnamed_field_info;
2878 uint64_t last_field_end = 0;
2887 if (last_field_end != 0 && ((last_field_end % word_width) != 0))
2888 last_field_end += word_width - (last_field_end % word_width);
2900 if (this_field_info.
bit_offset != last_field_end &&
2901 this_field_info.
bit_offset > last_field_end &&
2908 unnamed_field_info->bit_offset = last_field_end;
2911 if (unnamed_field_info) {
2912 clang::FieldDecl *unnamed_bitfield_decl =
2914 class_clang_type, llvm::StringRef(),
2917 attrs.accessibility, unnamed_field_info->bit_size);
2920 unnamed_bitfield_decl, unnamed_field_info->bit_offset));
2924 last_field_info = this_field_info;
2927 last_field_info.
bit_offset = field_bit_offset;
2929 if (std::optional<uint64_t> clang_type_size =
2931 last_field_info.
bit_size = *clang_type_size * character_width;
2945 if (attrs.is_artificial)
2959 uint64_t member_array_size;
2960 bool member_array_is_incomplete;
2962 if (member_clang_type.
IsArrayType(&member_array_element_type,
2964 &member_array_is_incomplete) &&
2965 !member_array_is_incomplete) {
2966 uint64_t parent_byte_size =
2969 if (attrs.member_byte_offset >= parent_byte_size) {
2970 if (member_array_size != 1 &&
2971 (member_array_size != 0 ||
2972 attrs.member_byte_offset > parent_byte_size)) {
2973 module_sp->ReportError(
2974 "{0:x8}: DW_TAG_member '{1}' refers to type {2:x16}"
2975 " which extends beyond the bounds of {3:x8}",
2976 die.
GetID(), attrs.name,
2977 attrs.encoding_form.Reference().GetOffset(), parent_die.
GetID());
2989 class_clang_type, attrs.name, member_clang_type, attrs.accessibility,
2995 std::make_pair(field_decl, field_bit_offset));
3000 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
3001 std::vector<DWARFDIE> &member_function_dies,
3020 case DW_TAG_APPLE_property:
3026 default_accessibility, layout_info, last_field_info);
3029 case DW_TAG_subprogram:
3031 member_function_dies.push_back(die);
3034 case DW_TAG_inheritance:
3036 module_sp, base_classes, layout_info);
3048 clang::DeclContext *containing_decl_ctx,
const DWARFDIE &parent_die,
3049 bool skip_artificial,
bool &is_static,
bool &is_variadic,
3050 bool &has_template_params, std::vector<CompilerType> &function_param_types,
3051 std::vector<clang::ParmVarDecl *> &function_param_decls,
3052 unsigned &type_quals) {
3060 case DW_TAG_formal_parameter: {
3062 const size_t num_attributes = die.
GetAttributes(attributes);
3063 if (num_attributes > 0) {
3064 const char *name =
nullptr;
3066 bool is_artificial =
false;
3069 clang::StorageClass storage = clang::SC_None;
3071 for (i = 0; i < num_attributes; ++i) {
3080 param_type_die_form = form_value;
3082 case DW_AT_artificial:
3083 is_artificial = form_value.
Boolean();
3085 case DW_AT_location:
3086 case DW_AT_const_value:
3087 case DW_AT_default_value:
3088 case DW_AT_description:
3089 case DW_AT_endianity:
3090 case DW_AT_is_optional:
3092 case DW_AT_variable_parameter:
3094 case DW_AT_abstract_origin:
3102 if (skip_artificial && is_artificial) {
3110 (name ==
nullptr || ::strcmp(name,
"this") == 0)) {
3119 type_quals |= clang::Qualifiers::Const;
3121 type_quals |= clang::Qualifiers::Volatile;
3133 clang::ParmVarDecl *param_var_decl =
3137 assert(param_var_decl);
3138 function_param_decls.push_back(param_var_decl);
3147 case DW_TAG_unspecified_parameters:
3151 case DW_TAG_template_type_parameter:
3152 case DW_TAG_template_value_parameter:
3153 case DW_TAG_GNU_template_parameter_pack:
3159 has_template_params =
true;
3173 const size_t num_attributes = die.
GetAttributes(attributes);
3174 if (num_attributes > 0) {
3176 for (
size_t i = 0; i < num_attributes; ++i) {
3180 if (attr == DW_AT_type &&
3194 switch (die.
Tag()) {
3195 case DW_TAG_variable:
3196 case DW_TAG_constant:
3197 case DW_TAG_formal_parameter:
3198 case DW_TAG_imported_declaration:
3199 case DW_TAG_imported_module:
3207 return cache_pos->second;
3222 clang::Decl *decl =
nullptr;
3223 switch (die.
Tag()) {
3224 case DW_TAG_variable:
3225 case DW_TAG_constant:
3226 case DW_TAG_formal_parameter: {
3229 if (
dwarf && type) {
3230 const char *name = die.
GetName();
3231 clang::DeclContext *decl_context =
3233 dwarf->GetDeclContextContainingUID(die.
GetID()));
3240 case DW_TAG_imported_declaration: {
3245 if (imported_decl) {
3246 clang::DeclContext *decl_context =
3248 dwarf->GetDeclContextContainingUID(die.
GetID()));
3249 if (clang::NamedDecl *clang_imported_decl =
3250 llvm::dyn_cast<clang::NamedDecl>(
3258 case DW_TAG_imported_module: {
3265 if (imported_decl_ctx) {
3266 clang::DeclContext *decl_context =
3268 dwarf->GetDeclContextContainingUID(die.
GetID()));
3269 if (clang::NamespaceDecl *ns_decl =
3294 bool try_parsing_type =
true;
3295 switch (die.
Tag()) {
3296 case DW_TAG_compile_unit:
3297 case DW_TAG_partial_unit:
3299 try_parsing_type =
false;
3302 case DW_TAG_namespace:
3304 try_parsing_type =
false;
3307 case DW_TAG_lexical_block:
3309 try_parsing_type =
false;
3316 if (decl_ctx ==
nullptr && try_parsing_type) {
3336 parent = parent.GetParent()) {
3338 if (tag == DW_TAG_module) {
3358 switch (die.
Tag()) {
3359 case DW_TAG_subprogram:
3360 case DW_TAG_inlined_subroutine:
3370 if (candidate.GetReferencedDIE(DW_AT_abstract_origin)) {
3377 assert(0 &&
"Shouldn't call GetContainingFunctionWithAbstractOrigin on "
3378 "something not in a function");
3384 if (candidate.GetReferencedDIE(DW_AT_abstract_origin)) {
3406 assert(die.
Tag() == DW_TAG_lexical_block);
3407 DWARFDIE containing_function_with_abstract_origin =
3409 if (!containing_function_with_abstract_origin) {
3413 die, containing_function_with_abstract_origin);
3420 if (die && die.
Tag() == DW_TAG_lexical_block) {
3421 clang::BlockDecl *decl =
3426 clang::DeclContext *decl_context =
3440clang::NamespaceDecl *
3442 if (die && die.
Tag() == DW_TAG_namespace) {
3445 clang::NamespaceDecl *namespace_decl =
3448 return namespace_decl;
3450 const char *namespace_name = die.
GetName();
3451 clang::DeclContext *containing_decl_ctx =
3462 return namespace_decl;
3472 DWARFDIE decl_ctx_die =
dwarf->GetDeclContextDIEContainingDIE(die);
3474 if (decl_ctx_die_copy)
3475 *decl_ctx_die_copy = decl_ctx_die;
3478 clang::DeclContext *clang_decl_ctx =
3481 return clang_decl_ctx;
3507 if (!class_type || !src_class_die || !dst_class_die)
3509 if (src_class_die.
Tag() != dst_class_die.
Tag())
3519 if (die.
Tag() != DW_TAG_subprogram)
3531 map_artificial.Append(const_name, die);
3533 map.Append(const_name, die);
3542 src_die = src_die.GetSibling()) {
3543 gather(src_die, src_name_to_die, src_name_to_die_artificial);
3546 dst_die = dst_die.GetSibling()) {
3547 gather(dst_die, dst_name_to_die, dst_name_to_die_artificial);
3553 bool fast_path =
true;
3555 if (src_size != dst_size)
3561 for (idx = 0; idx < src_size; ++idx) {
3565 if (src_die.
Tag() != dst_die.
Tag())
3572 if (src_name == dst_name || (strcmp(src_name, dst_name) == 0))
3588 clang::DeclContext *dst_decl_ctx =
3593 if (
Type *src_child_type = die_to_type[src.
GetDIE()])
3594 die_to_type[dst.GetDIE()] = src_child_type;
3601 for (idx = 0; idx < src_size; ++idx) {
3611 src_name_to_die.
Sort();
3613 for (idx = 0; idx < dst_size; ++idx) {
3618 if (src_die && (src_die.
Tag() == dst_die.
Tag()))
3619 link(src_die, dst_die);
3621 failures.push_back(dst_die);
3626 const uint32_t src_size_artificial = src_name_to_die_artificial.
GetSize();
3627 const uint32_t dst_size_artificial = dst_name_to_die_artificial.
GetSize();
3629 if (src_size_artificial && dst_size_artificial) {
3630 dst_name_to_die_artificial.
Sort();
3632 for (idx = 0; idx < src_size_artificial; ++idx) {
3638 dst_name_to_die_artificial.
Find(src_name_artificial,
DWARFDIE());
3642 link(src_die, dst_die);
3646 if (dst_size_artificial) {
3647 for (idx = 0; idx < dst_size_artificial; ++idx) {
3653 return !failures.empty();
static bool DeclKindIsCXXClass(clang::Decl::Kind decl_kind)
static std::string GetUnitName(const DWARFDIE &die)
static void ForcefullyCompleteType(CompilerType type)
static clang::CallingConv ConvertDWARFCallingConventionToClang(const ParsedDWARFTypeAttributes &attrs)
static bool IsSubroutine(const DWARFDIE &die)
static lldb::ModuleSP GetContainingClangModule(const DWARFDIE &die)
static DWARFDIE FindFirstChildWithAbstractOrigin(const DWARFDIE &block, const DWARFDIE &function)
static DWARFDIE FindAnyChildWithAbstractOrigin(const DWARFDIE &context)
static bool IsClangModuleFwdDecl(const DWARFDIE &Die)
Detect a forward declaration that is nested in a DW_TAG_module.
static DWARFDIE GetContainingClangModuleDIE(const DWARFDIE &die)
static DWARFDIE GetContainingFunctionWithAbstractOrigin(const DWARFDIE &die)
static void PrepareContextToReceiveMembers(TypeSystemClang &ast, ClangASTImporter &ast_importer, clang::DeclContext *decl_ctx, DWARFDIE die, const char *type_name_cstr)
This function serves a similar purpose as RequireCompleteType above, but it avoids completing the typ...
#define DEBUG_PRINTF(fmt,...)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
#define LLDB_LOG_ERROR(log, error,...)
#define DIE_IS_BEING_PARSED
const char * m_property_getter_name
CompilerType m_class_opaque_type
std::unique_ptr< ClangASTMetadata > m_metadata_up
DelayedAddObjCClassProperty(const CompilerType &class_opaque_type, const char *property_name, const CompilerType &property_opaque_type, const char *property_setter_name, const char *property_getter_name, uint32_t property_attributes, const ClangASTMetadata *metadata)
CompilerType m_property_opaque_type
const char * m_property_setter_name
uint32_t m_property_attributes
DelayedAddObjCClassProperty(const DelayedAddObjCClassProperty &rhs)
DelayedAddObjCClassProperty & operator=(const DelayedAddObjCClassProperty &rhs)
const char * m_property_name
bool CompleteRecordType(const DWARFDIE &die, lldb_private::Type *type, lldb_private::CompilerType &clang_type)
bool CompleteEnumType(const DWARFDIE &die, lldb_private::Type *type, lldb_private::CompilerType &clang_type)
lldb::TypeSP ParsePointerToMemberType(const DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
bool ParseTemplateDIE(const DWARFDIE &die, lldb_private::TypeSystemClang::TemplateParameterInfos &template_param_infos)
llvm::Expected< llvm::APInt > ExtractIntFromFormValue(const lldb_private::CompilerType &int_type, const DWARFFormValue &form_value) const
Extracts an value for a given Clang integer type from a DWARFFormValue.
std::unique_ptr< lldb_private::ClangASTImporter > m_clang_ast_importer_up
lldb::TypeSP ParseSubroutine(const DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
size_t ParseChildParameters(clang::DeclContext *containing_decl_ctx, const DWARFDIE &parent_die, bool skip_artificial, bool &is_static, bool &is_variadic, bool &has_template_params, std::vector< lldb_private::CompilerType > &function_args, std::vector< clang::ParmVarDecl * > &function_param_decls, unsigned &type_quals)
lldb_private::TypeSystemClang & m_ast
lldb_private::Function * ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit, const DWARFDIE &die, const lldb_private::AddressRange &func_range) override
lldb_private::ClangASTImporter & GetClangASTImporter()
clang::NamespaceDecl * ResolveNamespaceDIE(const DWARFDIE &die)
lldb_private::CompilerDeclContext GetDeclContextForUIDFromDWARF(const DWARFDIE &die) override
void ParseObjCProperty(const DWARFDIE &die, const DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, DelayedPropertyList &delayed_properties)
Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the list of delayed Objective-C pro...
lldb_private::CompilerDeclContext GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) override
DIEToDeclContextMap m_die_to_decl_ctx
lldb_private::Type * GetTypeForDIE(const DWARFDIE &die)
std::string GetCPlusPlusQualifiedName(const DWARFDIE &die)
void EnsureAllDIEsInDeclContextHaveBeenParsed(lldb_private::CompilerDeclContext decl_context) override
lldb::TypeSP ParseArrayType(const DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
size_t ParseChildEnumerators(lldb_private::CompilerType &compiler_type, bool is_signed, uint32_t enumerator_byte_size, const DWARFDIE &parent_die)
clang::DeclContext * GetCachedClangDeclContextForDIE(const DWARFDIE &die)
DIEToDeclMap m_die_to_decl
bool CopyUniqueClassMethodTypes(const DWARFDIE &src_class_die, const DWARFDIE &dst_class_die, lldb_private::Type *class_type, std::vector< DWARFDIE > &failures)
lldb::TypeSP UpdateSymbolContextScopeForType(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb::TypeSP type_sp)
If type_sp is valid, calculate and set its symbol context scope, and update the type list for its bac...
lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc, const DWARFDIE &die, bool *type_is_new_ptr) override
clang::DeclContext * GetClangDeclContextContainingDIE(const DWARFDIE &die, DWARFDIE *decl_ctx_die)
lldb::TypeSP ParseTypeModifier(const lldb_private::SymbolContext &sc, const DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
~DWARFASTParserClang() override
bool CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type, lldb_private::CompilerType &compiler_type) override
std::vector< DelayedAddObjCClassProperty > DelayedPropertyList
clang::BlockDecl * ResolveBlockDIE(const DWARFDIE &die)
lldb::TypeSP ParseStructureLikeDIE(const lldb_private::SymbolContext &sc, const DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
Parse a structure, class, or union type DIE.
lldb::TypeSP ParseEnum(const lldb_private::SymbolContext &sc, const DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
clang::DeclContext * GetDeclContextForBlock(const DWARFDIE &die)
lldb::TypeSP ParseTypeFromClangModule(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb_private::Log *log)
Follow Clang Module Skeleton CU references to find a type definition.
bool ParseChildMembers(const DWARFDIE &die, lldb_private::CompilerType &class_compiler_type, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > &base_classes, std::vector< DWARFDIE > &member_function_dies, DelayedPropertyList &delayed_properties, const lldb::AccessType default_accessibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
DIEToModuleMap m_die_to_module
DeclContextToDIEMap m_decl_ctx_to_die
void ParseInheritance(const DWARFDIE &die, const DWARFDIE &parent_die, const lldb_private::CompilerType class_clang_type, const lldb::AccessType default_accessibility, const lldb::ModuleSP &module_sp, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > &base_classes, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
Parses a DW_TAG_inheritance DIE into a base/super class.
lldb_private::OptionalClangModuleID GetOwningClangModule(const DWARFDIE &die)
lldb_private::ConstString GetDIEClassTemplateParams(const DWARFDIE &die) override
Returns the template parameters of a class DWARFDIE as a string.
void LinkDeclContextToDIE(clang::DeclContext *decl_ctx, const DWARFDIE &die)
void ParseSingleMember(const DWARFDIE &die, const DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, lldb::AccessType default_accessibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info, FieldInfo &last_field_info)
DWARFASTParserClang(lldb_private::TypeSystemClang &ast)
lldb_private::ConstString ConstructDemangledNameFromDWARF(const DWARFDIE &die) override
bool ParseTemplateParameterInfos(const DWARFDIE &parent_die, lldb_private::TypeSystemClang::TemplateParameterInfos &template_param_infos)
clang::DeclContext * GetClangDeclContextForDIE(const DWARFDIE &die)
clang::Decl * GetClangDeclForDIE(const DWARFDIE &die)
lldb_private::CompilerDecl GetDeclForUIDFromDWARF(const DWARFDIE &die) override
static lldb::AccessType GetAccessTypeFromDWARF(uint32_t dwarf_accessibility)
static std::optional< lldb_private::SymbolFile::ArrayInfo > ParseChildArrayInfo(const DWARFDIE &parent_die, const lldb_private::ExecutionContext *exe_ctx=nullptr)
dw_attr_t AttributeAtIndex(uint32_t i) const
DWARFUnit * CompileUnitAtIndex(uint32_t i) const
bool ExtractFormValueAtIndex(uint32_t i, DWARFFormValue &form_value) const
const char * GetTagAsCString() const
size_t GetAttributes(DWARFAttributes &attributes, Recurse recurse=Recurse::yes) const
const lldb_private::DWARFDataExtractor & GetData() const
const char * GetAttributeValueAsString(const dw_attr_t attr, const char *fail_value) const
DWARFUnit * GetCU() const
std::optional< DIERef > GetDIERef() const
SymbolFileDWARF * GetDWARF() const
bool Supports_DW_AT_APPLE_objc_complete_type() const
uint64_t GetAttributeValueAsUnsigned(const dw_attr_t attr, uint64_t fail_value) const
dw_offset_t GetOffset() const
lldb::user_id_t GetID() const
void GetName(lldb_private::Stream &s) const
DWARFDIE GetFirstChild() const
DWARFDIE GetParent() const
void GetDeclContext(llvm::SmallVectorImpl< lldb_private::CompilerContext > &context) const
Return this DIE's decl context as it is needed to look up types in Clang's -gmodules debug info forma...
const char * GetMangledName() const
DWARFDIE GetDIE(dw_offset_t die_offset) const
llvm::iterator_range< child_iterator > children() const
The range of all the children of this DIE.
DWARFDIE GetParentDeclContextDIE() const
bool GetDIENamesAndRanges(const char *&name, const char *&mangled, DWARFRangeList &ranges, int &decl_file, int &decl_line, int &decl_column, int &call_file, int &call_line, int &call_column, lldb_private::DWARFExpressionList *frame_base) const
lldb_private::Type * ResolveTypeUID(const DWARFDIE &die) const
DWARFDIE GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const
DWARFDIE GetReferencedDIE(const dw_attr_t attr) const
lldb_private::Type * ResolveType() const
const char * GetQualifiedName() const
SymbolFileDWARF & GetSymbolFileDWARF() const
bool Supports_unnamed_objc_bitfields()
lldb_private::FileSpec GetFile(size_t file_idx)
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die)
static DWARFASTParser * GetDWARFParser(DWARFUnit &unit)
static lldb::LanguageType GetLanguageFamily(DWARFUnit &unit)
Same as GetLanguage() but reports all C++ versions as C++ (no version).
lldb_private::Type * ResolveType(const DWARFDIE &die, bool assert_not_being_parsed=true, bool resolve_function_context=false)
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb_private::Type * > DIEToTypePtr
lldb::ModuleSP GetExternalModule(lldb_private::ConstString name)
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
static lldb_private::CompilerDecl GetDecl(const DWARFDIE &die)
static lldb::LanguageType GetLanguage(DWARFUnit &unit)
static DWARFDeclContext GetDWARFDeclContext(const DWARFDIE &die)
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die)
virtual DIEToTypePtr & GetDIEToType()
static lldb_private::CompilerDeclContext GetDeclContext(const DWARFDIE &die)
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
bool IsValid() const
Check if the object state is valid.
Block * FindBlockByID(lldb::user_id_t block_id)
Manages and observes all Clang AST node importing in LLDB.
CompilerType CopyType(TypeSystemClang &dst, const CompilerType &src_type)
Copies the given type and the respective declarations to the destination type system.
bool CanImport(const CompilerType &type)
Returns true iff the given type was copied from another TypeSystemClang and the original type in this...
void SetRecordLayout(clang::RecordDecl *decl, const LayoutInfo &layout)
Sets the layout for the given RecordDecl.
bool RequireCompleteType(clang::QualType type)
A class that describes a compilation unit.
void AddFunction(lldb::FunctionSP &function_sp)
Add a function to this compile unit.
Represents a generic declaration context in a program.
void * GetOpaqueDeclContext() const
Represents a generic declaration such as a function declaration.
void * GetOpaqueDecl() const
std::shared_ptr< TypeSystemType > dyn_cast_or_null()
Return a shared_ptr<TypeSystemType> if dyn_cast succeeds.
Generic representation of a type in a programming language.
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
bool IsArrayType(CompilerType *element_type=nullptr, uint64_t *size=nullptr, bool *is_incomplete=nullptr) const
bool IsCompleteType() const
lldb::opaque_compiler_type_t GetOpaqueQualType() const
bool IsBeingDefined() const
bool IsIntegerOrEnumerationType(bool &is_signed) const
ConstString GetTypeName(bool BaseOnly=false) const
bool IsIntegerType(bool &is_signed) const
bool GetCompleteType() const
Type Completion.
std::optional< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
void SetString(const llvm::StringRef &s)
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single ...
bool IsValid() const
Return true if the location expression contains data.
static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP module_sp, const DataExtractor &opcodes, const DWARFUnit *dwarf_cu, const lldb::RegisterKind reg_set, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr)
Evaluate a DWARF location expression in a particular context.
A class that describes the declaration location of a lldb object.
void SetLine(uint32_t line)
Set accessor for the declaration line number.
void SetColumn(uint16_t column)
Set accessor for the declaration column number.
void Clear()
Clear the object's state.
void SetFile(const FileSpec &file_spec)
Set accessor for the declaration file specification.
A class that describes a function.
Block & GetBlock(bool can_create)
Get accessor for the block list.
static bool LanguageIsCPlusPlus(lldb::LanguageType language)
static bool LanguageIsObjC(lldb::LanguageType language)
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
A class that describes an executable image and its associated object and symbol files.
ConstString GetClassName()
bool IsValid(bool strict) const
A plug-in interface definition class for object file parsers.
virtual lldb::ByteOrder GetByteOrder() const =0
Gets whether endian swapping should occur when extracting data from this object file.
unsigned int UInt(unsigned int fail_value=0) const
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
ObjectFile * GetObjectFile() override
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
The implementation of lldb::Type's m_payload field for TypeSystemClang.
void SetPackName(char const *name)
void SetParameterPack(std::unique_ptr< TemplateParameterInfos > args)
void InsertArg(char const *name, clang::TemplateArgument arg)
bool hasParameterPack() const
TemplateParameterInfos const & GetParameterPack() const
A TypeSystem implementation based on Clang.
clang::TranslationUnitDecl * GetTranslationUnitDecl()
void SetMetadata(const clang::Decl *object, ClangASTMetadata &meta_data)
CompilerType GetBasicType(lldb::BasicType type)
clang::UsingDecl * CreateUsingDeclaration(clang::DeclContext *current_decl_ctx, OptionalClangModuleID owning_module, clang::NamedDecl *target)
OptionalClangModuleID GetOrCreateClangModule(llvm::StringRef name, OptionalClangModuleID parent, bool is_framework=false, bool is_explicit=false)
Synthesize a clang::Module and return its ID or a default-constructed ID.
static clang::FieldDecl * AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, lldb::AccessType access, uint32_t bitfield_bit_size)
CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size) override
clang::FunctionTemplateDecl * CreateFunctionTemplateDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::FunctionDecl *func_decl, const TemplateParameterInfos &infos)
bool SetDeclIsForcefullyCompleted(const clang::TagDecl *td)
static clang::DeclContext * GetDeclContextForType(clang::QualType type)
static bool IsCXXClassType(const CompilerType &type)
static bool AddObjCClassProperty(const CompilerType &type, const char *property_name, const CompilerType &property_compiler_type, clang::ObjCIvarDecl *ivar_decl, const char *property_setter_name, const char *property_getter_name, uint32_t property_attributes, ClangASTMetadata *metadata)
CompilerType GetType(clang::QualType qt)
Creates a CompilerType from the given QualType with the current TypeSystemClang instance as the Compi...
static clang::TagDecl * GetAsTagDecl(const CompilerType &type)
bool TransferBaseClasses(lldb::opaque_compiler_type_t type, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > bases)
static void SetIntegerInitializerForVariable(clang::VarDecl *var, const llvm::APInt &init_value)
Initializes a variable with an integer value.
CompilerType CreateClassTemplateSpecializationType(clang::ClassTemplateSpecializationDecl *class_template_specialization_decl)
void CreateFunctionTemplateSpecializationInfo(clang::FunctionDecl *func_decl, clang::FunctionTemplateDecl *Template, const TemplateParameterInfos &infos)
CompilerDecl GetCompilerDecl(clang::Decl *decl)
Creates a CompilerDecl from the given Decl with the current TypeSystemClang instance as its typesyste...
CompilerType GetEnumerationIntegerType(lldb::opaque_compiler_type_t type) override
std::string PrintTemplateParams(const TemplateParameterInfos &template_param_infos)
Return the template parameters (including surrounding <>) in string form.
CompilerDeclContext CreateDeclContext(clang::DeclContext *ctx)
Creates a CompilerDeclContext from the given DeclContext with the current TypeSystemClang instance as...
void SetMetadataAsUserID(const clang::Decl *decl, lldb::user_id_t user_id)
static clang::RecordDecl * GetAsRecordDecl(const CompilerType &type)
clang::FunctionDecl * CreateFunctionDeclaration(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, llvm::StringRef name, const CompilerType &function_Type, clang::StorageClass storage, bool is_inline)
CompilerType GetBuiltinTypeForDWARFEncodingAndBitSize(llvm::StringRef type_name, uint32_t dw_ate, uint32_t bit_size)
static void BuildIndirectFields(const CompilerType &type)
void AddMethodOverridesForCXXRecordType(lldb::opaque_compiler_type_t type)
CompilerType CreateBlockPointerType(const CompilerType &function_type)
clang::ClassTemplateSpecializationDecl * CreateClassTemplateSpecializationDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::ClassTemplateDecl *class_template_decl, int kind, const TemplateParameterInfos &infos)
clang::CXXMethodDecl * AddMethodToCXXRecordType(lldb::opaque_compiler_type_t type, llvm::StringRef name, const char *mangled_name, const CompilerType &method_type, lldb::AccessType access, bool is_virtual, bool is_static, bool is_inline, bool is_explicit, bool is_attr_used, bool is_artificial)
clang::EnumConstantDecl * AddEnumerationValueToEnumerationType(const CompilerType &enum_type, const Declaration &decl, const char *name, int64_t enum_value, uint32_t enum_value_bit_size)
clang::NamespaceDecl * GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, bool is_inline=false)
static clang::CXXRecordDecl * GetAsCXXRecordDecl(lldb::opaque_compiler_type_t type)
clang::UsingDirectiveDecl * CreateUsingDirectiveDeclaration(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::NamespaceDecl *ns_decl)
clang::ASTContext & getASTContext()
Returns the clang::ASTContext instance managed by this TypeSystemClang.
static clang::ObjCMethodDecl * AddMethodToObjCObjectType(const CompilerType &type, const char *name, const CompilerType &method_compiler_type, lldb::AccessType access, bool is_artificial, bool is_variadic, bool is_objc_direct_call)
static bool CompleteTagDeclarationDefinition(const CompilerType &type)
static bool SetHasExternalStorage(lldb::opaque_compiler_type_t type, bool has_extern)
CompilerType CreateEnumerationType(llvm::StringRef name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, const Declaration &decl, const CompilerType &integer_qual_type, bool is_scoped)
clang::ParmVarDecl * CreateParameterDeclaration(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, const char *name, const CompilerType ¶m_type, int storage, bool add_decl=false)
static clang::NamespaceDecl * DeclContextGetAsNamespaceDecl(const CompilerDeclContext &dc)
CompilerType CreateArrayType(const CompilerType &element_type, size_t element_count, bool is_vector)
CompilerType GetTypeForDecl(clang::NamedDecl *decl)
static clang::DeclContext * DeclContextGetAsDeclContext(const CompilerDeclContext &dc)
static bool StartTagDeclarationDefinition(const CompilerType &type)
static clang::VarDecl * AddVariableToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &var_type, lldb::AccessType access)
CompilerType CreateFunctionType(const CompilerType &result_type, const CompilerType *args, unsigned num_args, bool is_variadic, unsigned type_quals, clang::CallingConv cc=clang::CC_C, clang::RefQualifierKind ref_qual=clang::RQ_None)
void SetFunctionParameters(clang::FunctionDecl *function_decl, llvm::ArrayRef< clang::ParmVarDecl * > params)
static bool IsObjCObjectOrInterfaceType(const CompilerType &type)
CompilerType CreateRecordType(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, llvm::StringRef name, int kind, lldb::LanguageType language, ClangASTMetadata *metadata=nullptr, bool exports_symbols=false)
static void RequireCompleteType(CompilerType type)
Complete a type from debug info, or mark it as forcefully completed if there is no definition of the ...
clang::TemplateTemplateParmDecl * CreateTemplateTemplateParmDecl(const char *template_name)
clang::ClassTemplateDecl * ParseClassTemplateDecl(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, const char *parent_name, int tag_decl_kind, const TypeSystemClang::TemplateParameterInfos &template_param_infos)
static CompilerType CreateMemberPointerType(const CompilerType &type, const CompilerType &pointee_type)
clang::VarDecl * CreateVariableDeclaration(clang::DeclContext *decl_context, OptionalClangModuleID owning_module, const char *name, clang::QualType type)
clang::BlockDecl * CreateBlockDeclaration(clang::DeclContext *ctx, OptionalClangModuleID owning_module)
CompilerType GetForwardCompilerType()
uint32_t GetEncodingMask()
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
@ eEncodingInvalid
Invalid encoding.
@ eEncodingIsTypedefUID
This type is alias to a type whose UID is m_encoding_uid.
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid.
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
CompilerType GetLayoutCompilerType()
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
CompilerType GetFullCompilerType()
ConstString GetCStringAtIndex(uint32_t idx) const
T GetValueAtIndexUnchecked(uint32_t idx) const
T Find(ConstString unique_cstr, T fail_value) const
Scalar & ResolveValue(ExecutionContext *exe_ctx)
llvm::dwarf::Tag dw_tag_t
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.
const char * DW_TAG_value_to_name(uint32_t val)
LanguageType
Programming language type.
@ eLanguageTypeObjC_plus_plus
Objective-C++.
@ eLanguageTypeObjC
Objective-C.
@ eEncodingSint
signed integer
@ eRegisterKindDWARF
the register numbers seen DWARF
bool NextBitfieldOffsetIsValid(const uint64_t next_bit_offset) const
void SetIsBitfield(bool flag)
Parsed form of all attributes that are relevant for type reconstruction.
lldb_private::Declaration decl
const char * mangled_name
lldb_private::ConstString name
lldb::AccessType accessibility
bool is_complete_objc_class
lldb::LanguageType class_language
bool is_forward_declaration
std::optional< uint64_t > byte_size
ParsedDWARFTypeAttributes(const DWARFDIE &die)
clang::StorageClass storage
DWARFFormValue specification
clang::RefQualifierKind ref_qual
Indicates ref-qualifier of C++ member function if present.
DWARFFormValue containing_type
DWARFFormValue abstract_origin
size_t calling_convention
llvm::DenseMap< const clang::FieldDecl *, uint64_t > field_offsets
static clang::QualType GetQualType(const CompilerType &ct)
static CompilerType RemoveFastQualifiers(const CompilerType &ct)
static clang::TagDecl * GetAsTagDecl(const CompilerType &type)
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
void Insert(lldb::LanguageType language)
lldb::user_id_t GetID() const
Get accessor for the user ID.