diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-27 18:18:05 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-27 18:18:05 +0000 |
commit | 8d852e35adb46e0799538dfc9c80d44f27cd3597 (patch) | |
tree | d20f984c9154db4e664612770705bc793e2a3095 /lib/CodeGen/CGExprCXX.cpp | |
parent | 0713d993cd0b4eb6a1b642c7d51d0f1845c1e986 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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<FinalAttr>()) 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<CXXDestructorDecl>(MD)) { |