summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-03-26 13:26:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-03-27 08:20:47 +0200
commitcbd1f3695f319c8aa4005d19e40a07c6b4dd116e (patch)
tree091c943ad8ee6c1dc758d1843b34791f526a88c9 /compilerplugins
parentadd1784e13abcfee48e6087e2160a5c6db941487 (diff)
Use isSamePathname instead of hasPathnamePrefix, where appropriate
Change-Id: I75f32fc66877c0fb1e71be3b5e8b6d6c1b9c4d36
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/blockblock.cxx2
-rw-r--r--compilerplugins/clang/checkunusedparams.cxx8
-rw-r--r--compilerplugins/clang/convertlong.cxx6
-rw-r--r--compilerplugins/clang/memoryvar.cxx2
-rw-r--r--compilerplugins/clang/useuniqueptr.cxx22
-rw-r--r--compilerplugins/clang/vclwidgets.cxx8
6 files changed, 24 insertions, 24 deletions
diff --git a/compilerplugins/clang/blockblock.cxx b/compilerplugins/clang/blockblock.cxx
index 910a3abf3750..065e4572e0e1 100644
--- a/compilerplugins/clang/blockblock.cxx
+++ b/compilerplugins/clang/blockblock.cxx
@@ -30,7 +30,7 @@ public:
{
StringRef fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() );
- if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/osl/unx/file_misc.cxx"))
+ if (loplugin::isSamePathname(fn, SRCDIR "/sal/osl/unx/file_misc.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
diff --git a/compilerplugins/clang/checkunusedparams.cxx b/compilerplugins/clang/checkunusedparams.cxx
index 8dbea6bd72a2..31dae1c66e61 100644
--- a/compilerplugins/clang/checkunusedparams.cxx
+++ b/compilerplugins/clang/checkunusedparams.cxx
@@ -68,16 +68,16 @@ void CheckUnusedParams::run()
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/xmloff/"))
return;
// I believe someone is busy working on this chunk of code
- if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/ui/docshell/dataprovider.cxx"))
+ if (loplugin::isSamePathname(fn, SRCDIR "/sc/source/ui/docshell/dataprovider.cxx"))
return;
// I think erack is working on stuff here
- if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/filter/excel/xiformula.cxx"))
+ if (loplugin::isSamePathname(fn, SRCDIR "/sc/source/filter/excel/xiformula.cxx"))
return;
// lots of callbacks here
- if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/filter/lotus/op.cxx"))
+ if (loplugin::isSamePathname(fn, SRCDIR "/sc/source/filter/lotus/op.cxx"))
return;
// template magic
- if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/filter/html/htmlpars.cxx"))
+ if (loplugin::isSamePathname(fn, SRCDIR "/sc/source/filter/html/htmlpars.cxx"))
return;
m_phase = PluginPhase::FindAddressOf;
diff --git a/compilerplugins/clang/convertlong.cxx b/compilerplugins/clang/convertlong.cxx
index 4d713aeecf2b..b706d7dffaa4 100644
--- a/compilerplugins/clang/convertlong.cxx
+++ b/compilerplugins/clang/convertlong.cxx
@@ -75,11 +75,11 @@ bool ConvertLong::VisitVarDecl(VarDecl const* varDecl)
if (ignoreLocation(varDecl))
return true;
StringRef fileName{ compiler.getSourceManager().getFilename(varDecl->getLocation()) };
- if (loplugin::hasPathnamePrefix(fileName, SRCDIR "/include/tools/bigint.hxx"))
+ if (loplugin::isSamePathname(fileName, SRCDIR "/include/tools/bigint.hxx"))
return true;
- if (loplugin::hasPathnamePrefix(fileName, SRCDIR "/include/tools/solar.h"))
+ if (loplugin::isSamePathname(fileName, SRCDIR "/include/tools/solar.h"))
return true;
- if (loplugin::hasPathnamePrefix(fileName, SRCDIR "/include/o3tl/string_view.hxx"))
+ if (loplugin::isSamePathname(fileName, SRCDIR "/include/o3tl/string_view.hxx"))
return true;
if (!varDecl->hasInit())
return true;
diff --git a/compilerplugins/clang/memoryvar.cxx b/compilerplugins/clang/memoryvar.cxx
index a381563d6509..168cc8bf175f 100644
--- a/compilerplugins/clang/memoryvar.cxx
+++ b/compilerplugins/clang/memoryvar.cxx
@@ -83,7 +83,7 @@ bool MemoryVar::TraverseFunctionDecl(FunctionDecl * decl)
if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/vcl/source/filter")) {
return true;
}
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sw/source/core/layout/frmtool.cxx")) {
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sw/source/core/layout/frmtool.cxx")) {
return true;
}
diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx
index dfa0917735f0..d8a4be063cb2 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -170,22 +170,22 @@ void UseUniquePtr::CheckDeleteExpr(const CXXDestructorDecl* destructorDecl, cons
if (loplugin::hasPathnamePrefix(aFileName, WORKDIR))
return;
// passes and stores pointers to member fields
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sot/source/sdstor/stgdir.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sot/source/sdstor/stgdir.hxx"))
return;
// something platform-specific
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/hwpfilter/source/htags.h"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/hwpfilter/source/htags.h"))
return;
// passes pointers to member fields
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sd/inc/sdpptwrp.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sd/inc/sdpptwrp.hxx"))
return;
// @TODO intrusive linked-lists here, with some trickiness
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sw/source/filter/html/parcss1.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sw/source/filter/html/parcss1.hxx"))
return;
// @TODO SwDoc has some weird ref-counting going on
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sw/inc/shellio.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sw/inc/shellio.hxx"))
return;
// @TODO it's sharing pointers with another class
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sc/inc/formulacell.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sc/inc/formulacell.hxx"))
return;
// some weird stuff going on here around struct Entity
if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sax/"))
@@ -198,23 +198,23 @@ void UseUniquePtr::CheckDeleteExpr(const CXXDestructorDecl* destructorDecl, cons
if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/sot/"))
return;
// the std::vector is being passed to another class
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sfx2/source/explorer/nochaos.cxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sfx2/source/explorer/nochaos.cxx"))
return;
// ignore std::map and std::unordered_map, MSVC 2015 has problems with mixing these with std::unique_ptr
auto tc = loplugin::TypeCheck(fieldDecl->getType());
if (tc.Class("map").StdNamespace() || tc.Class("unordered_map").StdNamespace())
return;
// there is a loop in ~ImplPrnQueueList deleting stuff on a global data structure
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/vcl/inc/print.h"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/vcl/inc/print.h"))
return;
// painful linked list
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/basic/source/inc/runtime.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/basic/source/inc/runtime.hxx"))
return;
// not sure how the node management is working here
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/i18npool/source/localedata/saxparser.cxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/i18npool/source/localedata/saxparser.cxx"))
return;
// has a pointer that it only sometimes owns
- if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/editeng/source/editeng/impedit.hxx"))
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/editeng/source/editeng/impedit.hxx"))
return;
report(
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index c2cfeaa08095..af2b1bf46cdd 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -240,9 +240,9 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(
pCXXDestructorDecl->getLocStart());
StringRef filename = compiler.getSourceManager().getFilename(spellingLocation);
- if ( !(loplugin::hasPathnamePrefix(filename, SRCDIR "/vcl/source/window/window.cxx"))
- && !(loplugin::hasPathnamePrefix(filename, SRCDIR "/vcl/source/gdi/virdev.cxx"))
- && !(loplugin::hasPathnamePrefix(filename, SRCDIR "/vcl/qa/cppunit/lifecycle.cxx")) )
+ if ( !(loplugin::isSamePathname(filename, SRCDIR "/vcl/source/window/window.cxx"))
+ && !(loplugin::isSamePathname(filename, SRCDIR "/vcl/source/gdi/virdev.cxx"))
+ && !(loplugin::isSamePathname(filename, SRCDIR "/vcl/qa/cppunit/lifecycle.cxx")) )
{
report(
DiagnosticsEngine::Warning,
@@ -670,7 +670,7 @@ bool VCLWidgets::VisitCXXDeleteExpr(const CXXDeleteExpr *pCXXDeleteExpr)
SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(
pCXXDeleteExpr->getLocStart());
StringRef filename = compiler.getSourceManager().getFilename(spellingLocation);
- if ( !(loplugin::hasPathnamePrefix(filename, SRCDIR "/include/vcl/vclreferencebase.hxx")))
+ if ( !(loplugin::isSamePathname(filename, SRCDIR "/include/vcl/vclreferencebase.hxx")))
{
report(
DiagnosticsEngine::Warning,