aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CXXInheritance.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-06-04 01:40:08 +0000
committerAnders Carlsson <andersca@mac.com>2010-06-04 01:40:08 +0000
commit1c4c397c581ad7106fc911fc4592c7aca163b5bc (patch)
tree327a11cb475002024661211a26052d80ce92aca9 /lib/AST/CXXInheritance.cpp
parent5d55376106f1aeabfab0bcd7e0167db904409a06 (diff)
Add a short circuit in isVirtuallyDerivedFrom.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CXXInheritance.cpp')
-rw-r--r--lib/AST/CXXInheritance.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp
index bdba01402c..c563c37d58 100644
--- a/lib/AST/CXXInheritance.cpp
+++ b/lib/AST/CXXInheritance.cpp
@@ -90,6 +90,9 @@ bool CXXRecordDecl::isDerivedFrom(CXXRecordDecl *Base, CXXBasePaths &Paths) cons
}
bool CXXRecordDecl::isVirtuallyDerivedFrom(CXXRecordDecl *Base) const {
+ if (!getNumVBases())
+ return false;
+
CXXBasePaths Paths(/*FindAmbiguities=*/false, /*RecordPaths=*/false,
/*DetectVirtual=*/false);