[Lldb-commits] [lldb] r115398 - /lldb/trunk/source/Symbol/ClangASTContext.cpp

Greg Clayton gclayton at apple.com
Fri Oct 1 18:40:05 PDT 2010


Author: gclayton
Date: Fri Oct  1 20:40:05 2010
New Revision: 115398

URL: http://llvm.org/viewvc/llvm-project?rev=115398&view=rev
Log:
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.


Modified:
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=115398&r1=115397&r2=115398&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Oct  1 20:40:05 2010
@@ -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,





More information about the lldb-commits mailing list