]> granicus.if.org Git - clang/commitdiff
Fix regression in vtable improvements.
authorEli Friedman <eli.friedman@gmail.com>
Fri, 4 Dec 2009 04:30:03 +0000 (04:30 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 4 Dec 2009 04:30:03 +0000 (04:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90540 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index 869bcc0e6a6f33efb37aa3e9b5740e096b8c13fa..5e448273729a9f4165408340735d1b2741ed36d6 100644 (file)
@@ -742,7 +742,7 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
        mi != e; ++mi) {
     GlobalDecl OGD;
     
-    const CXXMethodDecl *OMD = *mi;
+    const CXXMethodDecl *OMD = (*mi)->getCanonicalDecl();
     if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(OMD))
       OGD = GlobalDecl(DD, GD.getDtorType());
     else
@@ -933,7 +933,7 @@ void CGVtableInfo::ComputeMethodVtableIndices(const CXXRecordDecl *RD) {
     // Check if this method overrides a method in the primary base.
     for (CXXMethodDecl::method_iterator i = MD->begin_overridden_methods(),
          e = MD->end_overridden_methods(); i != e; ++i) {
-      const CXXMethodDecl *OverriddenMD = *i;
+      const CXXMethodDecl *OverriddenMD = (*i)->getCanonicalDecl();
       const CXXRecordDecl *OverriddenRD = OverriddenMD->getParent();
       assert(OverriddenMD->isCanonicalDecl() &&
              "Should have the canonical decl of the overridden RD!");