From 2c5f0e96c48417e6035fecda056084ee685bc531 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 4 Aug 2011 21:02:57 +0000 Subject: [PATCH] Make sure we track CXX and objc method decls. llvm-svn: 136920 --- lldb/include/lldb/Symbol/ClangASTContext.h | 7 +++++++ .../Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 3 +++ lldb/source/Symbol/ClangASTContext.cpp | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 3b0fe28999da..ffd5e1b16f43 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -300,6 +300,13 @@ public: is_explicit); } + static clang::DeclContext * + GetAsDeclContext (clang::CXXMethodDecl *cxx_method_decl); + + static clang::DeclContext * + GetAsDeclContext (clang::ObjCMethodDecl *objc_method_decl); + + static bool CheckOverloadedOperatorKindParameterCount (uint32_t op_kind, uint32_t num_params); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index f33b6446def9..c29a78db9b45 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3645,6 +3645,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, type_name_cstr, clang_type, accessibility); + LinkDeclContextToDIE(ClangASTContext::GetAsDeclContext(objc_method_decl), die); type_handled = objc_method_decl != NULL; } } @@ -3683,6 +3684,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, is_static, is_inline, is_explicit); + LinkDeclContextToDIE(ClangASTContext::GetAsDeclContext(cxx_method_decl), die); + type_handled = cxx_method_decl != NULL; } } diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index e937db0845f9..6915f7c94b74 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -4912,3 +4912,15 @@ ClangASTContext::GetCompleteDecl (clang::ASTContext *ast, } } +clang::DeclContext * +ClangASTContext::GetAsDeclContext (clang::CXXMethodDecl *cxx_method_decl) +{ + return clang::dyn_cast(cxx_method_decl); +} + +clang::DeclContext * +ClangASTContext::GetAsDeclContext (clang::ObjCMethodDecl *objc_method_decl) +{ + return clang::dyn_cast(objc_method_decl); +} + -- GitLab