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.

llvm-svn: 115398
This commit is contained in:
Greg Clayton 2010-10-02 01:40:05 +00:00
parent 1e190a552f
commit 90a2acd441
1 changed files with 6 additions and 7 deletions

View File

@ -1045,15 +1045,14 @@ ClangASTContext::AddMethodToCXXRecordType
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 @@ ClangASTContext::AddMethodToCXXRecordType
{
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 @@ ClangASTContext::AddMethodToCXXRecordType
{
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 @@ ClangASTContext::AddMethodToCXXRecordType
// 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,