[cfe-commits] r81583 - /cfe/trunk/lib/AST/DeclCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Sep 11 15:27:51 PDT 2009


Author: fjahanian
Date: Fri Sep 11 17:27:50 2009
New Revision: 81583

URL: http://llvm.org/viewvc/llvm-project?rev=81583&view=rev
Log:
No need to build the visible conversionfunction list for root class.


Modified:
    cfe/trunk/lib/AST/DeclCXX.cpp

Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=81583&r1=81582&r2=81583&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Fri Sep 11 17:27:50 2009
@@ -288,11 +288,16 @@
 OverloadedFunctionDecl *
 CXXRecordDecl::getVisibleConversionFunctions(ASTContext &Context,
                                              CXXRecordDecl *RD) {
-  // If visible conversion list is already evaluated, return it.
-  if (RD == this &&
-      VisibleConversions.function_begin() != VisibleConversions.function_end())
-    return &VisibleConversions;
-    
+  if (RD == this) {
+    // If root class, all conversions are visible.
+    if (RD->bases_begin() == RD->bases_end())
+      return &Conversions;
+    // If visible conversion list is already evaluated, return it.
+    if (VisibleConversions.function_begin() 
+        != VisibleConversions.function_end())
+      return &VisibleConversions;
+  }
+      
   QualType ClassType = Context.getTypeDeclType(this);
   if (const RecordType *Record = ClassType->getAs<RecordType>()) {
     OverloadedFunctionDecl *Conversions





More information about the cfe-commits mailing list