Make C++ constructors and destructors correctly within the clang types we
generate from DWARF.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115268 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 83d5709..6a03514 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -813,7 +813,8 @@
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 @@
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);