From 8d852e35adb46e0799538dfc9c80d44f27cd3597 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 27 Jun 2012 18:18:05 +0000 Subject: Implement John McCall's review of r159212 other than the this pointer not being updated. Will fix that in a second. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159280 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprCXX.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/CGExprCXX.cpp') diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index 372eb5407c..30324b97ef 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -102,8 +102,7 @@ static bool canDevirtualizeMemberFunctionCalls(ASTContext &Context, // b->f(); // } // - const CXXRecordDecl *MostDerivedClassDecl = - Base->getMostDerivedClassDeclForType(); + const CXXRecordDecl *MostDerivedClassDecl = Base->getBestDynamicClassType(); if (MostDerivedClassDecl->hasAttr()) return true; @@ -228,8 +227,7 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, bool UseVirtualCall = MD->isVirtual() && !ME->hasQualifier() && !canDevirtualizeMemberFunctionCalls(getContext(), Base, MD); - const CXXRecordDecl *MostDerivedClassDecl = - Base->getMostDerivedClassDeclForType(); + const CXXRecordDecl *MostDerivedClassDecl = Base->getBestDynamicClassType(); llvm::Value *Callee; if (const CXXDestructorDecl *Dtor = dyn_cast(MD)) { -- cgit v1.2.3