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/AST/Expr.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/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 7 |
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); } |