summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/fragiledestructor.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-05-18 09:56:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-05-18 09:56:01 +0200
commitdf8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d (patch)
treeea5daefc9c1665ab14aeeedc0de4298c7c85a8b1 /compilerplugins/clang/fragiledestructor.cxx
parent33cbc99fea5a3e4b87e883fd60ec97d4503109f3 (diff)
Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
Diffstat (limited to 'compilerplugins/clang/fragiledestructor.cxx')
-rw-r--r--compilerplugins/clang/fragiledestructor.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/compilerplugins/clang/fragiledestructor.cxx b/compilerplugins/clang/fragiledestructor.cxx
index e17418b26606..b438a81c33e3 100644
--- a/compilerplugins/clang/fragiledestructor.cxx
+++ b/compilerplugins/clang/fragiledestructor.cxx
@@ -48,12 +48,12 @@ bool FragileDestructor::TraverseCXXDestructorDecl(CXXDestructorDecl* pCXXDestruc
// ignore this for now, too tricky for me to work out
StringRef aFileName = compiler.getSourceManager().getFilename(
compiler.getSourceManager().getSpellingLoc(pCXXDestructorDecl->getLocStart()));
- if (aFileName.startswith(SRCDIR "/include/comphelper/")
- || aFileName.startswith(SRCDIR "/include/cppuhelper/")
- || aFileName.startswith(SRCDIR "/cppuhelper/")
- || aFileName.startswith(SRCDIR "/comphelper/")
+ if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/comphelper/")
+ || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/cppuhelper/")
+ || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/cppuhelper/")
+ || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/comphelper/")
// don't 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"
+ || loplugin::isSamePathname(aFileName, SRCDIR "/basic/source/sbx/sbxvalue.cxx")
)
return RecursiveASTVisitor::TraverseCXXDestructorDecl(pCXXDestructorDecl);
mbChecking = true;
@@ -87,9 +87,9 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr
}
// e.g. osl/thread.hxx and cppuhelper/compbase.hxx
StringRef aFileName = compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(methodDecl->getLocStart()));
- if (aFileName.startswith(SRCDIR "/include/osl/")
- || aFileName.startswith(SRCDIR "/include/comphelper/")
- || aFileName.startswith(SRCDIR "/include/cppuhelper/"))
+ if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/osl/")
+ || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/comphelper/")
+ || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/cppuhelper/"))
return true;
report(
DiagnosticsEngine::Warning,