[cfe-commits] r105457 - /cfe/trunk/lib/AST/CXXInheritance.cpp

Anders Carlsson andersca at mac.com
Thu Jun 3 18:40:09 PDT 2010


Author: andersca
Date: Thu Jun  3 20:40:08 2010
New Revision: 105457

URL: http://llvm.org/viewvc/llvm-project?rev=105457&view=rev
Log:
Add a short circuit in isVirtuallyDerivedFrom.

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

Modified: cfe/trunk/lib/AST/CXXInheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CXXInheritance.cpp?rev=105457&r1=105456&r2=105457&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CXXInheritance.cpp (original)
+++ cfe/trunk/lib/AST/CXXInheritance.cpp Thu Jun  3 20:40:08 2010
@@ -90,6 +90,9 @@
 }
 
 bool CXXRecordDecl::isVirtuallyDerivedFrom(CXXRecordDecl *Base) const {
+  if (!getNumVBases())
+    return false;
+
   CXXBasePaths Paths(/*FindAmbiguities=*/false, /*RecordPaths=*/false,
                      /*DetectVirtual=*/false);
 





More information about the cfe-commits mailing list