One final patch for all of this class constructor, destructor, and conversion
operator naming stuff. We now get the constructor and destructor names right
after passing in the type, and we get the correct conversion operator name
after passing in the return type when getting the DeclarationNameInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115398 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index e1742a8..92de68f 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -1045,15 +1045,14 @@
DeclarationName decl_name (&identifier_table->get(name));
- ;
const bool is_implicitly_declared = false;
- clang::Type *method_type(method_qual_type.getTypePtr());
+ clang::FunctionType *function_Type = dyn_cast<FunctionType>(method_qual_type.getTypePtr());
- if (method_type == NULL)
+ if (function_Type == NULL)
return NULL;
- FunctionProtoType *method_function_prototype (dyn_cast<FunctionProtoType>(method_type));
+ FunctionProtoType *method_function_prototype (dyn_cast<FunctionProtoType>(function_Type));
if (!method_function_prototype)
return NULL;
@@ -1064,7 +1063,7 @@
{
cxx_method_decl = CXXDestructorDecl::Create (*ast_context,
cxx_record_decl,
- DeclarationNameInfo (ast_context->DeclarationNames.getCXXDestructorName (ast_context->getCanonicalType (method_qual_type)), SourceLocation()),
+ DeclarationNameInfo (ast_context->DeclarationNames.getCXXDestructorName (ast_context->getCanonicalType (record_qual_type)), SourceLocation()),
method_qual_type,
is_inline,
is_implicitly_declared);
@@ -1073,7 +1072,7 @@
{
cxx_method_decl = CXXConstructorDecl::Create (*ast_context,
cxx_record_decl,
- DeclarationNameInfo (ast_context->DeclarationNames.getCXXConstructorName (ast_context->getCanonicalType (method_qual_type)), SourceLocation()),
+ DeclarationNameInfo (ast_context->DeclarationNames.getCXXConstructorName (ast_context->getCanonicalType (record_qual_type)), SourceLocation()),
method_qual_type,
NULL, // TypeSourceInfo *
is_explicit,
@@ -1102,7 +1101,7 @@
// Conversion operators don't take params...
cxx_method_decl = CXXConversionDecl::Create (*ast_context,
cxx_record_decl,
- DeclarationNameInfo (ast_context->DeclarationNames.getCXXConversionFunctionName (ast_context->getCanonicalType (method_qual_type)), SourceLocation()),
+ DeclarationNameInfo (ast_context->DeclarationNames.getCXXConversionFunctionName (ast_context->getCanonicalType (function_Type->getResultType())), SourceLocation()),
method_qual_type,
NULL, // TypeSourceInfo *
is_inline,