diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-12 11:31:25 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-12 09:33:30 +0000 |
commit | e12fbdd64b83f988191b8d085c99467fd8a52555 (patch) | |
tree | dca21b1207bf1ff891dd2dbc29ccc75cbcc3daf4 /compilerplugins/clang/fragiledestructor.cxx | |
parent | 0727e6e79994b66836841978a554b7f6855449dc (diff) |
only traverse the dtor's statements once
rather than twice, once implicitly from TraverseCXXDestructorDecl and
explicitly from VisitCXXDestructorDecl
Change-Id: I62a794faa530f2b54b82c86de0629afa28f30091
Reviewed-on: https://gerrit.libreoffice.org/27139
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'compilerplugins/clang/fragiledestructor.cxx')
-rw-r--r-- | compilerplugins/clang/fragiledestructor.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/compilerplugins/clang/fragiledestructor.cxx b/compilerplugins/clang/fragiledestructor.cxx index ebce1d677f8b..d4b7e6136ea6 100644 --- a/compilerplugins/clang/fragiledestructor.cxx +++ b/compilerplugins/clang/fragiledestructor.cxx @@ -29,7 +29,7 @@ public: virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } - bool VisitCXXDestructorDecl(const CXXDestructorDecl *); + bool TraverseCXXDestructorDecl(CXXDestructorDecl *); bool VisitCXXMemberCallExpr(const CXXMemberCallExpr *); @@ -37,13 +37,13 @@ private: bool mbChecking = false; }; -bool FragileDestructor::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorDecl) +bool FragileDestructor::TraverseCXXDestructorDecl(CXXDestructorDecl* pCXXDestructorDecl) { if (ignoreLocation(pCXXDestructorDecl)) { - return true; + return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl); } if (!pCXXDestructorDecl->isThisDeclarationADefinition()) { - return true; + return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl); } // ignore this for now, too tricky for me to work out StringRef aFileName = compiler.getSourceManager().getFilename( @@ -55,12 +55,11 @@ bool FragileDestructor::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDest // dont know how to detect this in clang - it is making an explicit call to it's own method, so presumably OK || aFileName == SRCDIR "/basic/source/sbx/sbxvalue.cxx" ) - return true; + return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl); mbChecking = true; - Stmt * pStmt = pCXXDestructorDecl->getBody(); - TraverseStmt(pStmt); + bool ret = RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl); mbChecking = false; - return true; + return ret; } bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr) |