use shared-plugin infra for some recent plugins

Change-Id: Ia9cba59718de91fed2045ffd7e0ec06d28bf37dc
Reviewed-on: https://gerrit.libreoffice.org/78118
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-08-26 11:19:56 +02:00
parent 761e6dd257
commit e87761688d
6 changed files with 136 additions and 17 deletions

View File

@@ -6,6 +6,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef LO_CLANG_SHARED_PLUGINS
#include "check.hxx"
#include "plugin.hxx"
@@ -23,18 +24,23 @@ public:
{
}
void run() override;
bool preRun() override
{
StringRef fn(handler.getMainFileName());
return !loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/");
}
void run() override
{
if (preRun())
{
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
}
bool VisitCXXMemberCallExpr(CXXMemberCallExpr const*);
};
void StringBuffer::run()
{
StringRef fn(handler.getMainFileName());
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
bool StringBuffer::VisitCXXMemberCallExpr(CXXMemberCallExpr const* memberCallExpr)
{
if (ignoreLocation(memberCallExpr))
@@ -60,8 +66,10 @@ bool StringBuffer::VisitCXXMemberCallExpr(CXXMemberCallExpr const* memberCallExp
return true;
}
loplugin::Plugin::Registration<StringBuffer> X("stringbuffer");
loplugin::Plugin::Registration<StringBuffer> stringbuffer("stringbuffer");
} // namespace
#endif // LO_CLANG_SHARED_PLUGINS
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */