aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-06-27 18:18:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-06-27 18:18:05 +0000
commit8d852e35adb46e0799538dfc9c80d44f27cd3597 (patch)
treed20f984c9154db4e664612770705bc793e2a3095 /lib/AST/Expr.cpp
parent0713d993cd0b4eb6a1b642c7d51d0f1845c1e986 (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/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 22d15be6a8..15cf6602b7 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -33,7 +33,7 @@
#include <cstring>
using namespace clang;
-const CXXRecordDecl *Expr::getMostDerivedClassDeclForType() const {
+const CXXRecordDecl *Expr::getBestDynamicClassType() const {
const Expr *E = this;
while (true) {
@@ -51,15 +51,10 @@ const CXXRecordDecl *Expr::getMostDerivedClassDeclForType() const {
}
QualType DerivedType = E->getType();
- if (DerivedType->isDependentType())
- return NULL;
if (const PointerType *PTy = DerivedType->getAs<PointerType>())
DerivedType = PTy->getPointeeType();
const RecordType *Ty = DerivedType->castAs<RecordType>();
- if (!Ty)
- return NULL;
-
Decl *D = Ty->getDecl();
return cast<CXXRecordDecl>(D);
}