diff options
-rw-r--r-- | lldb/include/lldb/Symbol/ClangASTContext.h | 9 | ||||
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 15 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 38 |
4 files changed, 52 insertions, 18 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 3aed5750345..135ce55df53 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -190,7 +190,8 @@ public: lldb::AccessType access, bool is_virtual, bool is_static, - bool is_inline); + bool is_inline, + bool is_explicit); clang::CXXMethodDecl * AddMethodToCXXRecordType (lldb::clang_type_t record_opaque_type, @@ -199,7 +200,8 @@ public: lldb::AccessType access, bool is_virtual, bool is_static, - bool is_inline) + bool is_inline, + bool is_explicit) { return ClangASTContext::AddMethodToCXXRecordType (getASTContext(), @@ -209,7 +211,8 @@ public: access, is_virtual, is_static, - is_inline); + is_inline, + is_explicit); } bool diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 43c4150a0f9..2c244bda95f 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1119,11 +1119,12 @@ ClangExpressionDeclMap::AddOneType(NameSearchContext &context, 1, false, ClangASTContext::GetTypeQualifiers(copied_type)); - + const bool is_virtual = false; const bool is_static = false; const bool is_inline = false; - + const bool is_explicit = false; + ClangASTContext::AddMethodToCXXRecordType (parser_ast_context, copied_type, "___clang_expr", @@ -1131,7 +1132,8 @@ ClangExpressionDeclMap::AddOneType(NameSearchContext &context, lldb::eAccessPublic, is_virtual, is_static, - is_inline); + is_inline, + is_explicit); } context.AddTypeDecl(copied_type); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 9447929793c..f7a177dc533 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2797,6 +2797,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, bool is_inline = false; bool is_static = false; bool is_virtual = false; + bool is_explicit = false; unsigned type_quals = 0; clang::StorageClass storage = clang::SC_None;//, Extern, Static, PrivateExtern @@ -2828,6 +2829,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, case DW_AT_declaration: is_forward_declaration = form_value.Unsigned() != 0; break; case DW_AT_inline: is_inline = form_value.Unsigned() != 0; break; case DW_AT_virtuality: is_virtual = form_value.Unsigned() != 0; break; + case DW_AT_explicit: is_explicit = form_value.Unsigned() != 0; break; + case DW_AT_external: if (form_value.Unsigned()) { @@ -2846,7 +2849,6 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, case DW_AT_data_location: case DW_AT_elemental: case DW_AT_entry_pc: - case DW_AT_explicit: case DW_AT_frame_base: case DW_AT_high_pc: case DW_AT_low_pc: @@ -2872,12 +2874,17 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } clang_type_t return_clang_type = NULL; - Type *func_type = ResolveTypeUID(type_die_offset); + Type *func_type = NULL; + + if (type_die_offset != DW_INVALID_OFFSET) + func_type = ResolveTypeUID(type_die_offset); + if (func_type) return_clang_type = func_type->GetClangType(true); else return_clang_type = type_list->GetClangASTContext().GetBuiltInType_void(); + std::vector<clang_type_t> function_param_types; std::vector<clang::ParmVarDecl*> function_param_decls; @@ -2887,6 +2894,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // clang_type will get the function prototype clang type after this call clang_type = type_list->GetClangASTContext().CreateFunctionType (return_clang_type, &function_param_types[0], function_param_types.size(), is_variadic, type_quals); + if (type_name_cstr) { bool type_handled = false; @@ -2960,7 +2968,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, accessibility, is_virtual, is_static, - is_inline); + is_inline, + is_explicit); type_handled = cxx_method_decl != NULL; } } diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 83d57091503..6a03514b962 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -813,7 +813,8 @@ ClangASTContext::AddMethodToCXXRecordType lldb::AccessType access, bool is_virtual, bool is_static, - bool is_inline + bool is_inline, + bool is_explicit ) { if (!record_opaque_type || !method_opaque_type || !name) @@ -849,15 +850,34 @@ ClangASTContext::AddMethodToCXXRecordType QualType method_qual_type (QualType::getFromOpaquePtr (method_opaque_type)); - CXXMethodDecl *cxx_method_decl = CXXMethodDecl::Create (*ast_context, - cxx_record_decl, - DeclarationNameInfo (DeclarationName (&identifier_table->get(name)), SourceLocation()), - method_qual_type, - NULL, // TypeSourceInfo * - is_static, - SC_None, - is_inline); + CXXMethodDecl *cxx_method_decl = NULL; + + DeclarationName decl_name (&identifier_table->get(name)); + if (name[0] == '~' || decl_name == record_decl->getDeclName()) + { + bool is_implicitly_declared = false; + cxx_method_decl = CXXConstructorDecl::Create (*ast_context, + cxx_record_decl, + DeclarationNameInfo (decl_name, SourceLocation()), + method_qual_type, + NULL, // TypeSourceInfo * + is_explicit, + is_inline, + is_implicitly_declared); + } + else + { + cxx_method_decl = CXXMethodDecl::Create (*ast_context, + cxx_record_decl, + DeclarationNameInfo (decl_name, SourceLocation()), + method_qual_type, + NULL, // TypeSourceInfo * + is_static, + SC_None, + is_inline); + } + AccessSpecifier access_specifier = ConvertAccessTypeToAccessSpecifier (access); |