diff options
author | Anders Carlsson <andersca@mac.com> | 2010-04-17 17:24:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-04-17 17:24:33 +0000 |
commit | fbf05613db16a521ce124391388891c488c47a0c (patch) | |
tree | 3ada79cd53c7f4a871cb33095c5f13ebeb22949e /lib/CodeGen | |
parent | f6cde77d7bc34bbee26b086ff192637af8e9da59 (diff) |
Fix a bug where we would sometimes incorrectly mark an vtable function as unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 462384f82f..28530ecbb4 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -1608,15 +1608,12 @@ VTableBuilder::AddMethod(const CXXMethodDecl *MD, static bool OverridesIndirectMethodInBases(const CXXMethodDecl *MD, VTableBuilder::PrimaryBasesSetVectorTy &Bases) { + if (Bases.count(MD->getParent())) + return true; + for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(), E = MD->end_overridden_methods(); I != E; ++I) { const CXXMethodDecl *OverriddenMD = *I; - const CXXRecordDecl *OverriddenRD = OverriddenMD->getParent(); - assert(OverriddenMD->isCanonicalDecl() && - "Should have the canonical decl of the overridden RD!"); - - if (Bases.count(OverriddenRD)) - return true; // Check "indirect overriders". if (OverridesIndirectMethodInBases(OverriddenMD, Bases)) |