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>
This commit is contained in:
committed by
Noel Grandin
parent
0727e6e799
commit
e12fbdd64b
@@ -29,7 +29,7 @@ public:
|
|||||||
|
|
||||||
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
|
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
|
||||||
|
|
||||||
bool VisitCXXDestructorDecl(const CXXDestructorDecl *);
|
bool TraverseCXXDestructorDecl(CXXDestructorDecl *);
|
||||||
|
|
||||||
bool VisitCXXMemberCallExpr(const CXXMemberCallExpr *);
|
bool VisitCXXMemberCallExpr(const CXXMemberCallExpr *);
|
||||||
|
|
||||||
@@ -37,13 +37,13 @@ private:
|
|||||||
bool mbChecking = false;
|
bool mbChecking = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool FragileDestructor::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorDecl)
|
bool FragileDestructor::TraverseCXXDestructorDecl(CXXDestructorDecl* pCXXDestructorDecl)
|
||||||
{
|
{
|
||||||
if (ignoreLocation(pCXXDestructorDecl)) {
|
if (ignoreLocation(pCXXDestructorDecl)) {
|
||||||
return true;
|
return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl);
|
||||||
}
|
}
|
||||||
if (!pCXXDestructorDecl->isThisDeclarationADefinition()) {
|
if (!pCXXDestructorDecl->isThisDeclarationADefinition()) {
|
||||||
return true;
|
return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl);
|
||||||
}
|
}
|
||||||
// ignore this for now, too tricky for me to work out
|
// ignore this for now, too tricky for me to work out
|
||||||
StringRef aFileName = compiler.getSourceManager().getFilename(
|
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
|
// 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"
|
|| aFileName == SRCDIR "/basic/source/sbx/sbxvalue.cxx"
|
||||||
)
|
)
|
||||||
return true;
|
return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl);
|
||||||
mbChecking = true;
|
mbChecking = true;
|
||||||
Stmt * pStmt = pCXXDestructorDecl->getBody();
|
bool ret = RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl);
|
||||||
TraverseStmt(pStmt);
|
|
||||||
mbChecking = false;
|
mbChecking = false;
|
||||||
return true;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr)
|
bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr)
|
||||||
|
Reference in New Issue
Block a user