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

Greg Clayton gclayton at apple.com
Thu Mar 22 15:23:18 PDT 2012


Author: gclayton
Date: Thu Mar 22 17:23:17 2012
New Revision: 153284

URL: http://llvm.org/viewvc/llvm-project?rev=153284&view=rev
Log:
<rdar://problem/11095005> 

Fixed a performance regression when dynamic types are enable where we would ask a C++ type if it can possibly be dynamic. Previously we would force the type to complete itself and then anwwer the question definitively. Now we ask the type if it is already complete and only definitively answer the question for completed types and just say "yes" for non-complete C++ types. We also always now answer yes for Objective C classes and do not complete those types either.


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=153284&r1=153283&r2=153284&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Mar 22 17:23:17 2012
@@ -5512,7 +5512,13 @@
                         CXXRecordDecl *cxx_record_decl = pointee_qual_type->getAsCXXRecordDecl();
                         if (cxx_record_decl)
                         {
-                            if (GetCompleteQualType (ast, pointee_qual_type))
+                            // Do NOT complete the type here like we used to do
+                            // otherwise EVERY "class *" variable we have will try
+                            // to fully complete itself and this will take a lot of
+                            // time, memory and slow down debugging. If we have a complete
+                            // type, then answer the question definitively, else we
+                            // just say that a C++ class can possibly be dynamic...
+                            if (cxx_record_decl->getDefinition())
                             {
                                 success = cxx_record_decl->isDynamicClass();
                             }
@@ -5535,17 +5541,9 @@
                     
                 case clang::Type::ObjCObject:
                 case clang::Type::ObjCInterface:
-                    {
-                        const clang::ObjCObjectType *objc_class_type = pointee_qual_type->getAsObjCQualifiedInterfaceType();
-                        if (objc_class_type)
-                        {
-                            GetCompleteQualType (ast, pointee_qual_type);
-                            if (dynamic_pointee_type)
-                                *dynamic_pointee_type = pointee_qual_type.getAsOpaquePtr();
-                            return true;
-                        }
-                    }
-                    break;
+                    if (dynamic_pointee_type)
+                        *dynamic_pointee_type = pointee_qual_type.getAsOpaquePtr();
+                    return true;
 
                 default:
                     break;





More information about the lldb-commits mailing list