diff options
75 files changed, 152 insertions, 149 deletions
diff --git a/compilerplugins/clang/automem.cxx b/compilerplugins/clang/automem.cxx index 5c3d740bb9d0..30f3223b89f9 100644 --- a/compilerplugins/clang/automem.cxx +++ b/compilerplugins/clang/automem.cxx @@ -23,10 +23,10 @@ namespace { class AutoMem: - public RecursiveASTVisitor<AutoMem>, public loplugin::Plugin + public loplugin::FilteringPlugin<AutoMem> { public: - explicit AutoMem(loplugin::InstantiationData const & data): Plugin(data), mbInsideDestructor(false) {} + explicit AutoMem(loplugin::InstantiationData const & data): FilteringPlugin(data), mbInsideDestructor(false) {} virtual void run() override { diff --git a/compilerplugins/clang/badstatics.cxx b/compilerplugins/clang/badstatics.cxx index d91f3b430a30..43c26558ccbc 100644 --- a/compilerplugins/clang/badstatics.cxx +++ b/compilerplugins/clang/badstatics.cxx @@ -15,13 +15,12 @@ namespace { class BadStatics - : public clang::RecursiveASTVisitor<BadStatics> - , public loplugin::Plugin + : public loplugin::FilteringPlugin<BadStatics> { public: explicit BadStatics(loplugin::InstantiationData const& rData): - Plugin(rData) {} + FilteringPlugin(rData) {} void run() override { if (compiler.getLangOpts().CPlusPlus) { // no non-trivial dtors in C diff --git a/compilerplugins/clang/commaoperator.cxx b/compilerplugins/clang/commaoperator.cxx index 431cb10a68a9..e619d3794c58 100644 --- a/compilerplugins/clang/commaoperator.cxx +++ b/compilerplugins/clang/commaoperator.cxx @@ -28,11 +28,11 @@ Stmt const * lookThroughExprWithCleanups(Stmt const * stmt) { } class CommaOperator: - public RecursiveASTVisitor<CommaOperator>, public loplugin::Plugin + public loplugin::FilteringPlugin<CommaOperator> { public: explicit CommaOperator(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { diff --git a/compilerplugins/clang/cppunitassertequals.cxx b/compilerplugins/clang/cppunitassertequals.cxx index 39fa3d8989bf..135a7e5c829a 100644 --- a/compilerplugins/clang/cppunitassertequals.cxx +++ b/compilerplugins/clang/cppunitassertequals.cxx @@ -21,11 +21,11 @@ namespace { class CppunitAssertEquals: - public RecursiveASTVisitor<CppunitAssertEquals>, public loplugin::Plugin + public loplugin::FilteringPlugin<CppunitAssertEquals> { public: explicit CppunitAssertEquals(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx index 07f59d8858e5..253f19ef651c 100644 --- a/compilerplugins/clang/cstylecast.cxx +++ b/compilerplugins/clang/cstylecast.cxx @@ -165,10 +165,10 @@ bool canBeUsedForFunctionalCast(TypeSourceInfo const * info) { } class CStyleCast: - public RecursiveASTVisitor<CStyleCast>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<CStyleCast> { public: - explicit CStyleCast(loplugin::InstantiationData const & data): RewritePlugin(data) + explicit CStyleCast(loplugin::InstantiationData const & data): FilteringRewritePlugin(data) {} virtual void run() override { diff --git a/compilerplugins/clang/derefnullptr.cxx b/compilerplugins/clang/derefnullptr.cxx index db7b3b9eb5ed..cc5ffe431a2f 100644 --- a/compilerplugins/clang/derefnullptr.cxx +++ b/compilerplugins/clang/derefnullptr.cxx @@ -12,11 +12,11 @@ namespace { class DerefNullPtr: - public RecursiveASTVisitor<DerefNullPtr>, public loplugin::Plugin + public loplugin::FilteringPlugin<DerefNullPtr> { public: explicit DerefNullPtr(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/externandnotdefined.cxx b/compilerplugins/clang/externandnotdefined.cxx index 97dff5a8dfa3..faf6bffb136c 100644 --- a/compilerplugins/clang/externandnotdefined.cxx +++ b/compilerplugins/clang/externandnotdefined.cxx @@ -17,10 +17,10 @@ namespace { class ExternAndNotDefined: - public RecursiveASTVisitor<ExternAndNotDefined>, public loplugin::Plugin + public loplugin::FilteringPlugin<ExternAndNotDefined> { public: - explicit ExternAndNotDefined(loplugin::InstantiationData const & data): Plugin(data) {} + explicit ExternAndNotDefined(loplugin::InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/faileddyncast.cxx b/compilerplugins/clang/faileddyncast.cxx index eee5be57d584..ef52b09a185d 100644 --- a/compilerplugins/clang/faileddyncast.cxx +++ b/compilerplugins/clang/faileddyncast.cxx @@ -90,11 +90,11 @@ bool isAlwaysNull(CXXDynamicCastExpr const * expr) { } class FailedDynCast: - public RecursiveASTVisitor<FailedDynCast>, public loplugin::Plugin + public loplugin::FilteringPlugin<FailedDynCast> { public: explicit FailedDynCast(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} bool shouldVisitTemplateInstantiations() const { return true; } diff --git a/compilerplugins/clang/getimplementationname.cxx b/compilerplugins/clang/getimplementationname.cxx index 4c8f2d19ee73..cf234079750e 100644 --- a/compilerplugins/clang/getimplementationname.cxx +++ b/compilerplugins/clang/getimplementationname.cxx @@ -74,12 +74,11 @@ std::string replace_all(std::string subject, const std::string& search, const st } class GetImplementationName: - public clang::RecursiveASTVisitor<GetImplementationName>, - public loplugin::Plugin + public loplugin::FilteringPlugin<GetImplementationName> { public: explicit GetImplementationName(loplugin::InstantiationData const & data) - : Plugin(data) + : FilteringPlugin(data) , m_Outdir(initOutdir()) , m_OutdirCreated(false) , m_Srcdir(initSrcdir()) diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx index dd1eb4c1718b..4afc4ad0b92a 100644 --- a/compilerplugins/clang/implicitboolconversion.cxx +++ b/compilerplugins/clang/implicitboolconversion.cxx @@ -221,11 +221,11 @@ bool hasCLanguageLinkageType(FunctionDecl const * decl) { } class ImplicitBoolConversion: - public RecursiveASTVisitor<ImplicitBoolConversion>, public loplugin::Plugin + public loplugin::FilteringPlugin<ImplicitBoolConversion> { public: explicit ImplicitBoolConversion(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/inlinesimplememberfunctions.cxx b/compilerplugins/clang/inlinesimplememberfunctions.cxx index 64734dc9de9a..668e9f252ab6 100644 --- a/compilerplugins/clang/inlinesimplememberfunctions.cxx +++ b/compilerplugins/clang/inlinesimplememberfunctions.cxx @@ -18,10 +18,10 @@ namespace { class InlineSimpleMemberFunctions: - public RecursiveASTVisitor<InlineSimpleMemberFunctions>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<InlineSimpleMemberFunctions> { public: - explicit InlineSimpleMemberFunctions(loplugin::InstantiationData const & data): RewritePlugin(data) {} + explicit InlineSimpleMemberFunctions(loplugin::InstantiationData const & data): FilteringRewritePlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/inlinevisible.cxx b/compilerplugins/clang/inlinevisible.cxx index 6f0b63856178..c32eb9b0d74c 100644 --- a/compilerplugins/clang/inlinevisible.cxx +++ b/compilerplugins/clang/inlinevisible.cxx @@ -18,11 +18,11 @@ namespace { class InlineVisible: - public RecursiveASTVisitor<InlineVisible>, public loplugin::Plugin + public loplugin::FilteringPlugin<InlineVisible> { public: explicit InlineVisible(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/literaltoboolconversion.cxx b/compilerplugins/clang/literaltoboolconversion.cxx index 270ebc3455ca..32e820502f39 100644 --- a/compilerplugins/clang/literaltoboolconversion.cxx +++ b/compilerplugins/clang/literaltoboolconversion.cxx @@ -18,12 +18,11 @@ namespace { class LiteralToBoolConversion: - public RecursiveASTVisitor<LiteralToBoolConversion>, - public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<LiteralToBoolConversion> { public: explicit LiteralToBoolConversion(loplugin::InstantiationData const & data): - RewritePlugin(data) {} + FilteringRewritePlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/loopvartoosmall.cxx b/compilerplugins/clang/loopvartoosmall.cxx index b59462171f88..c2f2533bea45 100644 --- a/compilerplugins/clang/loopvartoosmall.cxx +++ b/compilerplugins/clang/loopvartoosmall.cxx @@ -23,11 +23,11 @@ namespace { class LoopVarTooSmall: - public RecursiveASTVisitor<LoopVarTooSmall>, public loplugin::Plugin + public loplugin::FilteringPlugin<LoopVarTooSmall> { public: explicit LoopVarTooSmall(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/compilerplugins/clang/memoryvar.cxx b/compilerplugins/clang/memoryvar.cxx index 590af94b7c7a..d3842f4f3eb5 100644 --- a/compilerplugins/clang/memoryvar.cxx +++ b/compilerplugins/clang/memoryvar.cxx @@ -22,10 +22,10 @@ namespace { class MemoryVar: - public RecursiveASTVisitor<MemoryVar>, public loplugin::Plugin + public loplugin::FilteringPlugin<MemoryVar> { public: - explicit MemoryVar(loplugin::InstantiationData const & data): Plugin(data), mbChecking(false) {} + explicit MemoryVar(loplugin::InstantiationData const & data): FilteringPlugin(data), mbChecking(false) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/compilerplugins/clang/mergeclasses.cxx b/compilerplugins/clang/mergeclasses.cxx index ce08d627b931..bac4a36df1d8 100644 --- a/compilerplugins/clang/mergeclasses.cxx +++ b/compilerplugins/clang/mergeclasses.cxx @@ -47,11 +47,11 @@ static std::set<std::pair<std::string,std::string> > childToParentClassSet; // c static std::map<std::string,std::string> definitionMap; // className -> filename class MergeClasses: - public RecursiveASTVisitor<MergeClasses>, public loplugin::Plugin + public loplugin::FilteringPlugin<MergeClasses> { public: explicit MergeClasses(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { diff --git a/compilerplugins/clang/nullptr.cxx b/compilerplugins/clang/nullptr.cxx index c463caec7c5d..bcdf606c13e3 100644 --- a/compilerplugins/clang/nullptr.cxx +++ b/compilerplugins/clang/nullptr.cxx @@ -52,11 +52,11 @@ bool isNullPointerCast(CastExpr const * expr) { } class Nullptr: - public RecursiveASTVisitor<Nullptr>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<Nullptr> { public: explicit Nullptr(loplugin::InstantiationData const & data): - RewritePlugin(data) {} + FilteringRewritePlugin(data) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/oncevar.cxx b/compilerplugins/clang/oncevar.cxx index be03b4d96589..587c8cb059ca 100644 --- a/compilerplugins/clang/oncevar.cxx +++ b/compilerplugins/clang/oncevar.cxx @@ -76,10 +76,10 @@ public: }; class OnceVar: - public RecursiveASTVisitor<OnceVar>, public loplugin::Plugin + public loplugin::FilteringPlugin<OnceVar> { public: - explicit OnceVar(loplugin::InstantiationData const & data): Plugin(data) {} + explicit OnceVar(loplugin::InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override { // ignore some files with problematic macros diff --git a/compilerplugins/clang/override.cxx b/compilerplugins/clang/override.cxx index c25405b8ef4a..bd63792c3e28 100644 --- a/compilerplugins/clang/override.cxx +++ b/compilerplugins/clang/override.cxx @@ -20,11 +20,11 @@ namespace { class Override: - public RecursiveASTVisitor<Override>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<Override> { public: explicit Override(loplugin::InstantiationData const & data): - RewritePlugin(data) {} + FilteringRewritePlugin(data) {} virtual void run() override; diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx index 61bd3cf0f00c..1fd14619b62f 100644 --- a/compilerplugins/clang/passstuffbyref.cxx +++ b/compilerplugins/clang/passstuffbyref.cxx @@ -28,10 +28,10 @@ namespace { class PassStuffByRef: - public RecursiveASTVisitor<PassStuffByRef>, public loplugin::Plugin + public loplugin::FilteringPlugin<PassStuffByRef> { public: - explicit PassStuffByRef(loplugin::InstantiationData const & data): Plugin(data), mbInsideFunctionDecl(false), mbFoundReturnValueDisqualifier(false) {} + explicit PassStuffByRef(loplugin::InstantiationData const & data): FilteringPlugin(data), mbInsideFunctionDecl(false), mbFoundReturnValueDisqualifier(false) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx index 0820f311c1a1..d9ed85db0f85 100644 --- a/compilerplugins/clang/plugin.hxx +++ b/compilerplugins/clang/plugin.hxx @@ -102,6 +102,19 @@ private: const char* name; }; +template<typename Derived> +class FilteringPlugin : public RecursiveASTVisitor<Derived>, public Plugin +{ +public: + explicit FilteringPlugin( const InstantiationData& data ) : Plugin(data) {} + + bool TraverseNamespaceDecl(NamespaceDecl * decl) { + if (ignoreLocation(decl->getLocStart())) + return true; + return RecursiveASTVisitor<Derived>::TraverseNamespaceDecl(decl); + } +}; + /** Base class for rewriter plugins. @@ -227,6 +240,19 @@ RewritePlugin::RewriteOption operator|( RewritePlugin::RewriteOption option1, Re return static_cast< RewritePlugin::RewriteOption >( int( option1 ) | int( option2 )); } +template<typename Derived> +class FilteringRewritePlugin : public RecursiveASTVisitor<Derived>, public RewritePlugin +{ +public: + explicit FilteringRewritePlugin( const InstantiationData& data ) : RewritePlugin(data) {} + + bool TraverseNamespaceDecl(NamespaceDecl * decl) { + if (ignoreLocation(decl->getLocStart())) + return true; + return RecursiveASTVisitor<Derived>::TraverseNamespaceDecl(decl); + } +}; + void normalizeDotDotInFilePath(std::string&); // Same as pathname.startswith(prefix), except on Windows, where pathname and diff --git a/compilerplugins/clang/privatebase.cxx b/compilerplugins/clang/privatebase.cxx index 3b1862a7bc6c..5e92aaa7ea9c 100644 --- a/compilerplugins/clang/privatebase.cxx +++ b/compilerplugins/clang/privatebase.cxx @@ -12,10 +12,10 @@ namespace { class PrivateBase: - public RecursiveASTVisitor<PrivateBase>, public loplugin::Plugin + public loplugin::FilteringPlugin<PrivateBase> { public: - explicit PrivateBase(loplugin::InstantiationData const & data): Plugin(data) + explicit PrivateBase(loplugin::InstantiationData const & data): FilteringPlugin(data) {} void run() override; diff --git a/compilerplugins/clang/ptrvector.cxx b/compilerplugins/clang/ptrvector.cxx index dc3a69d0a9b7..40e37e5937c9 100644 --- a/compilerplugins/clang/ptrvector.cxx +++ b/compilerplugins/clang/ptrvector.cxx @@ -23,10 +23,10 @@ namespace { class PtrVector: - public RecursiveASTVisitor<PtrVector>, public loplugin::Plugin + public loplugin::FilteringPlugin<PtrVector> { public: - explicit PtrVector(loplugin::InstantiationData const & data): Plugin(data) + explicit PtrVector(loplugin::InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override diff --git a/compilerplugins/clang/rangedforcopy.cxx b/compilerplugins/clang/rangedforcopy.cxx index 4a05de1c6558..a8a6e7d6cfbb 100644 --- a/compilerplugins/clang/rangedforcopy.cxx +++ b/compilerplugins/clang/rangedforcopy.cxx @@ -22,11 +22,11 @@ namespace { class RangedForCopy: - public RecursiveASTVisitor<RangedForCopy>, public loplugin::Plugin + public loplugin::FilteringPlugin<RangedForCopy> { public: explicit RangedForCopy(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx index ad7818f4a981..d390a7e15ccc 100644 --- a/compilerplugins/clang/redundantcast.cxx +++ b/compilerplugins/clang/redundantcast.cxx @@ -78,11 +78,11 @@ AlgebraicType algebraicType(clang::Type const & type) { } class RedundantCast: - public RecursiveASTVisitor<RedundantCast>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<RedundantCast> { public: explicit RedundantCast(loplugin::InstantiationData const & data): - RewritePlugin(data) + FilteringRewritePlugin(data) {} virtual void run() override { diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx index 426127c76862..6ae861cfcad9 100644 --- a/compilerplugins/clang/refcounting.cxx +++ b/compilerplugins/clang/refcounting.cxx @@ -38,10 +38,10 @@ not delete on last 'release'. namespace { class RefCounting: - public RecursiveASTVisitor<RefCounting>, public loplugin::Plugin + public loplugin::FilteringPlugin<RefCounting> { public: - explicit RefCounting(loplugin::InstantiationData const & data): Plugin(data) + explicit RefCounting(loplugin::InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/rendercontext.cxx b/compilerplugins/clang/rendercontext.cxx index ada566561377..8a4e8bd69a9c 100644 --- a/compilerplugins/clang/rendercontext.cxx +++ b/compilerplugins/clang/rendercontext.cxx @@ -20,11 +20,11 @@ namespace { class RenderContext: - public RecursiveASTVisitor<RenderContext>, public loplugin::Plugin + public loplugin::FilteringPlugin<RenderContext> { public: explicit RenderContext(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx index f0024e96da27..9b664e626f0d 100644 --- a/compilerplugins/clang/salbool.cxx +++ b/compilerplugins/clang/salbool.cxx @@ -143,11 +143,11 @@ bool hasBoolOverload(FunctionDecl const * decl, bool mustBeDeleted) { } class SalBool: - public RecursiveASTVisitor<SalBool>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<SalBool> { public: explicit SalBool(loplugin::InstantiationData const & data): - RewritePlugin(data) {} + FilteringRewritePlugin(data) {} virtual void run() override; diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx index 9100b8973f00..50e25a3f04e6 100644 --- a/compilerplugins/clang/sallogareas.cxx +++ b/compilerplugins/clang/sallogareas.cxx @@ -29,7 +29,7 @@ if appropriate. */ SalLogAreas::SalLogAreas( const InstantiationData& data ) - : Plugin(data), inFunction(nullptr) + : FilteringPlugin(data), inFunction(nullptr) { } diff --git a/compilerplugins/clang/sallogareas.hxx b/compilerplugins/clang/sallogareas.hxx index 9cb035069e10..b9f57bdd4d6c 100644 --- a/compilerplugins/clang/sallogareas.hxx +++ b/compilerplugins/clang/sallogareas.hxx @@ -20,8 +20,7 @@ namespace loplugin { class SalLogAreas - : public RecursiveASTVisitor< SalLogAreas > - , public Plugin + : public FilteringPlugin< SalLogAreas > { public: explicit SalLogAreas( const InstantiationData& data ); diff --git a/compilerplugins/clang/sfxpoolitem.cxx b/compilerplugins/clang/sfxpoolitem.cxx index c64e35a33790..bd2870fe06d3 100644 --- a/compilerplugins/clang/sfxpoolitem.cxx +++ b/compilerplugins/clang/sfxpoolitem.cxx @@ -22,10 +22,10 @@ forgotten and hard to notice. namespace { class SfxPoolItem: - public RecursiveASTVisitor<SfxPoolItem>, public loplugin::Plugin + public loplugin::FilteringPlugin<SfxPoolItem> { public: - explicit SfxPoolItem(loplugin::InstantiationData const & data): Plugin(data) + explicit SfxPoolItem(loplugin::InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/simplifybool.cxx b/compilerplugins/clang/simplifybool.cxx index 23f75a9a6705..7109fcfb96a9 100644 --- a/compilerplugins/clang/simplifybool.cxx +++ b/compilerplugins/clang/simplifybool.cxx @@ -76,11 +76,11 @@ Value getValue(Expr const * expr) { } class SimplifyBool: - public RecursiveASTVisitor<SimplifyBool>, public loplugin::Plugin + public loplugin::FilteringPlugin<SimplifyBool> { public: explicit SimplifyBool(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} void run() override; diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx index b18f9c79c8b1..7d9b28d956da 100644 --- a/compilerplugins/clang/staticmethods.cxx +++ b/compilerplugins/clang/staticmethods.cxx @@ -18,12 +18,12 @@ namespace { class StaticMethods: - public RecursiveASTVisitor<StaticMethods>, public loplugin::Plugin + public loplugin::FilteringPlugin<StaticMethods> { private: bool bVisitedThis; public: - explicit StaticMethods(loplugin::InstantiationData const & data): Plugin(data), bVisitedThis(false) {} + explicit StaticMethods(loplugin::InstantiationData const & data): FilteringPlugin(data), bVisitedThis(false) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/store/cascadingassignop.cxx b/compilerplugins/clang/store/cascadingassignop.cxx index 1d08217f177e..660689b9c77b 100644 --- a/compilerplugins/clang/store/cascadingassignop.cxx +++ b/compilerplugins/clang/store/cascadingassignop.cxx @@ -40,7 +40,7 @@ struct WalkCounter // Ctor, nothing special, pass the argument(s). CascadingAssignOp::CascadingAssignOp( const InstantiationData& data ) - : Plugin( data ) + : FilteringPlugin( data ) { } diff --git a/compilerplugins/clang/store/cascadingassignop.hxx b/compilerplugins/clang/store/cascadingassignop.hxx index fa776c7a3ba4..adc3eac77ba7 100644 --- a/compilerplugins/clang/store/cascadingassignop.hxx +++ b/compilerplugins/clang/store/cascadingassignop.hxx @@ -22,9 +22,7 @@ struct WalkCounter; // The class implementing the plugin action. class CascadingAssignOp // Inherits from the Clang class that will allow examing the Clang AST tree (i.e. syntax tree). - : public RecursiveASTVisitor< CascadingAssignOp > - // And the base class for LO Clang plugins. - , public Plugin + : public FilteringPlugin< CascadingAssignOp > { public: CascadingAssignOp( const InstantiationData& data ); diff --git a/compilerplugins/clang/store/cascadingcondop.cxx b/compilerplugins/clang/store/cascadingcondop.cxx index c868e5e468a2..8164e4614f6b 100644 --- a/compilerplugins/clang/store/cascadingcondop.cxx +++ b/compilerplugins/clang/store/cascadingcondop.cxx @@ -39,7 +39,7 @@ struct WalkCounter // Ctor, nothing special, pass the argument(s). CascadingCondOp::CascadingCondOp( const InstantiationData& data ) - : Plugin( data ) + : FilteringPlugin( data ) { } diff --git a/compilerplugins/clang/store/cascadingcondop.hxx b/compilerplugins/clang/store/cascadingcondop.hxx index 8d41177ec051..5bdf11093957 100644 --- a/compilerplugins/clang/store/cascadingcondop.hxx +++ b/compilerplugins/clang/store/cascadingcondop.hxx @@ -22,9 +22,7 @@ struct WalkCounter; // The class implementing the plugin action. class CascadingCondOp // Inherits from the Clang class that will allow examing the Clang AST tree (i.e. syntax tree). - : public RecursiveASTVisitor< CascadingCondOp > - // And the base class for LO Clang plugins. - , public Plugin + : public FilteringPlugin< CascadingCondOp > { public: CascadingCondOp( const InstantiationData& data ); diff --git a/compilerplugins/clang/store/changefunctioncalls.cxx b/compilerplugins/clang/store/changefunctioncalls.cxx index a728ad5a310a..9f5390a2150c 100644 --- a/compilerplugins/clang/store/changefunctioncalls.cxx +++ b/compilerplugins/clang/store/changefunctioncalls.cxx @@ -33,8 +33,7 @@ namespace loplugin { class ChangeFunctionCalls - : public RecursiveASTVisitor< ChangeFunctionCalls > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< ChangeFunctionCalls > { public: explicit ChangeFunctionCalls( CompilerInstance& compiler, Rewriter& rewriter ); @@ -43,7 +42,7 @@ class ChangeFunctionCalls }; ChangeFunctionCalls::ChangeFunctionCalls( CompilerInstance& compiler, Rewriter& rewriter ) - : RewritePlugin( compiler, rewriter ) + : FilteringRewritePlugin( compiler, rewriter ) { } diff --git a/compilerplugins/clang/store/constantfunction.cxx b/compilerplugins/clang/store/constantfunction.cxx index f3dd4f8a39c5..b2be6b90532d 100644 --- a/compilerplugins/clang/store/constantfunction.cxx +++ b/compilerplugins/clang/store/constantfunction.cxx @@ -19,11 +19,11 @@ namespace { class ConstantFunction: - public RecursiveASTVisitor<ConstantFunction>, public loplugin::Plugin + public loplugin::FilteringPlugin<ConstantFunction> { StringRef getFilename(const FunctionDecl* functionDecl); public: - explicit ConstantFunction(InstantiationData const & data): Plugin(data) {} + explicit ConstantFunction(InstantiationData const & data): FilteringRewritePlugin(data) {} void run() override { diff --git a/compilerplugins/clang/store/deletedspecial.cxx b/compilerplugins/clang/store/deletedspecial.cxx index 7b29fcf5a76e..5d66de352184 100644 --- a/compilerplugins/clang/store/deletedspecial.cxx +++ b/compilerplugins/clang/store/deletedspecial.cxx @@ -32,10 +32,10 @@ CXXRecordDecl const * getClass(CXXMethodDecl const * decl) { } class DeletedSpecial: - public RecursiveASTVisitor<DeletedSpecial>, public loplugin::Plugin + public loplugin::FilteringPlugin<DeletedSpecial> { public: - explicit DeletedSpecial(InstantiationData const & data): Plugin(data) {} + explicit DeletedSpecial(InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override; diff --git a/compilerplugins/clang/store/derivedclass.cxx b/compilerplugins/clang/store/derivedclass.cxx index 95f0296b4537..bc4a396930e2 100644 --- a/compilerplugins/clang/store/derivedclass.cxx +++ b/compilerplugins/clang/store/derivedclass.cxx @@ -12,12 +12,11 @@ namespace { class DerivedClass: - public RecursiveASTVisitor<DerivedClass>, - public loplugin::Plugin + public loplugin::FilteringPlugin<DerivedClass> { public: explicit DerivedClass(InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/store/findoncontainer.cxx b/compilerplugins/clang/store/findoncontainer.cxx index 99efb9caab56..09f51187aef0 100644 --- a/compilerplugins/clang/store/findoncontainer.cxx +++ b/compilerplugins/clang/store/findoncontainer.cxx @@ -22,10 +22,10 @@ namespace { class FindOnContainer: - public RecursiveASTVisitor<FindOnContainer>, public loplugin::Plugin + public loplugin::FilteringPlugin<FindOnContainer> { public: - explicit FindOnContainer(InstantiationData const & data): Plugin(data) {} + explicit FindOnContainer(InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/store/lclstaticfix.cxx b/compilerplugins/clang/store/lclstaticfix.cxx index 81210bd5641f..01e4171fc4f4 100644 --- a/compilerplugins/clang/store/lclstaticfix.cxx +++ b/compilerplugins/clang/store/lclstaticfix.cxx @@ -21,7 +21,7 @@ namespace loplugin { LclStaticFix::LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter ) - : RewritePlugin( compiler, rewriter ) + : FilteringRewritePlugin( compiler, rewriter ) { } diff --git a/compilerplugins/clang/store/lclstaticfix.hxx b/compilerplugins/clang/store/lclstaticfix.hxx index a42801f6f0d4..e15420e63927 100644 --- a/compilerplugins/clang/store/lclstaticfix.hxx +++ b/compilerplugins/clang/store/lclstaticfix.hxx @@ -18,8 +18,7 @@ namespace loplugin { class LclStaticFix - : public RecursiveASTVisitor< LclStaticFix > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< LclStaticFix > { public: explicit LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter ); diff --git a/compilerplugins/clang/store/paintmethodconversion.cxx b/compilerplugins/clang/store/paintmethodconversion.cxx index e19a0f416819..f8c63d4b98ce 100644 --- a/compilerplugins/clang/store/paintmethodconversion.cxx +++ b/compilerplugins/clang/store/paintmethodconversion.cxx @@ -43,11 +43,11 @@ bool isDerivedFromWindow(const CXXRecordDecl* decl) { return false; } -class PaintMethodConversion: public RecursiveASTVisitor<PaintMethodConversion>, public loplugin::RewritePlugin +class PaintMethodConversion: public loplugin::FilteringRewritePlugin<PaintMethodConversion> { public: explicit PaintMethodConversion(InstantiationData const& data): - RewritePlugin(data) + FilteringRewritePlugin(data) {} virtual void run() override diff --git a/compilerplugins/clang/store/postfixincrementfix.cxx b/compilerplugins/clang/store/postfixincrementfix.cxx index c4ad68591817..eba6f35b5ab8 100644 --- a/compilerplugins/clang/store/postfixincrementfix.cxx +++ b/compilerplugins/clang/store/postfixincrementfix.cxx @@ -21,7 +21,7 @@ namespace loplugin { PostfixIncrementFix::PostfixIncrementFix( const InstantiationData& data ) - : RewritePlugin( data ) + : FilteringRewritePlugin( data ) { } diff --git a/compilerplugins/clang/store/postfixincrementfix.hxx b/compilerplugins/clang/store/postfixincrementfix.hxx index 60dc93bb79f6..6cc2470e6ee7 100644 --- a/compilerplugins/clang/store/postfixincrementfix.hxx +++ b/compilerplugins/clang/store/postfixincrementfix.hxx @@ -18,8 +18,7 @@ namespace loplugin { class PostfixIncrementFix - : public RecursiveASTVisitor< PostfixIncrementFix > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< PostfixIncrementFix > { public: explicit PostfixIncrementFix( const InstantiationData& data ); diff --git a/compilerplugins/clang/store/referencecasting.cxx b/compilerplugins/clang/store/referencecasting.cxx index 4466fb66e122..ed74b0b6e14a 100644 --- a/compilerplugins/clang/store/referencecasting.cxx +++ b/compilerplugins/clang/store/referencecasting.cxx @@ -33,7 +33,7 @@ I have logged a bug here: */ ReferenceCasting::ReferenceCasting( CompilerInstance& compiler ) - : Plugin( compiler ) + : FilteringPlugin( compiler ) { } diff --git a/compilerplugins/clang/store/referencecasting.hxx b/compilerplugins/clang/store/referencecasting.hxx index eab7a7784b47..3c41b773e0f0 100644 --- a/compilerplugins/clang/store/referencecasting.hxx +++ b/compilerplugins/clang/store/referencecasting.hxx @@ -18,8 +18,7 @@ namespace loplugin { class ReferenceCasting - : public RecursiveASTVisitor< ReferenceCasting > - , public Plugin + : public FilteringPlugin< ReferenceCasting > { public: explicit ReferenceCasting( CompilerInstance& compiler ); diff --git a/compilerplugins/clang/store/removeforwardstringdecl.cxx b/compilerplugins/clang/store/removeforwardstringdecl.cxx index c70d7a8e2eb2..e7a546a8f5d3 100644 --- a/compilerplugins/clang/store/removeforwardstringdecl.cxx +++ b/compilerplugins/clang/store/removeforwardstringdecl.cxx @@ -21,7 +21,7 @@ namespace loplugin { RemoveForwardStringDecl::RemoveForwardStringDecl( CompilerInstance& compiler, Rewriter& rewriter ) - : RewritePlugin( compiler, rewriter ) + : FilteringRewritePlugin( compiler, rewriter ) { } diff --git a/compilerplugins/clang/store/removeforwardstringdecl.hxx b/compilerplugins/clang/store/removeforwardstringdecl.hxx index d8e2e7ea5fb8..ef2c3f96743f 100644 --- a/compilerplugins/clang/store/removeforwardstringdecl.hxx +++ b/compilerplugins/clang/store/removeforwardstringdecl.hxx @@ -18,8 +18,7 @@ namespace loplugin { class RemoveForwardStringDecl - : public RecursiveASTVisitor< RemoveForwardStringDecl > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< RemoveForwardStringDecl > { public: explicit RemoveForwardStringDecl( CompilerInstance& compiler, Rewriter& rewriter ); diff --git a/compilerplugins/clang/store/removevirtuals.cxx b/compilerplugins/clang/store/removevirtuals.cxx index e44cb738629e..1dc98304d2ba 100644 --- a/compilerplugins/clang/store/removevirtuals.cxx +++ b/compilerplugins/clang/store/removevirtuals.cxx @@ -26,7 +26,7 @@ namespace { class RemoveVirtuals: - public RecursiveASTVisitor<RemoveVirtuals>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<RemoveVirtuals> { public: explicit RemoveVirtuals(InstantiationData const & data); @@ -50,7 +50,7 @@ size_t getFilesize(const char* filename) return st.st_size; } -RemoveVirtuals::RemoveVirtuals(InstantiationData const & data): RewritePlugin(data) +RemoveVirtuals::RemoveVirtuals(InstantiationData const & data): FilteringRewritePlugin(data) { static const char sInputFile[] = SRCDIR "/result.txt"; mmapFilesize = getFilesize(sInputFile); diff --git a/compilerplugins/clang/store/returnunique.cxx b/compilerplugins/clang/store/returnunique.cxx index d97d5253d97b..913c043a4712 100644 --- a/compilerplugins/clang/store/returnunique.cxx +++ b/compilerplugins/clang/store/returnunique.cxx @@ -18,10 +18,10 @@ namespace { class ReturnUnique: - public RecursiveASTVisitor<ReturnUnique>, public loplugin::Plugin + public loplugin::FilteringPlugin<ReturnUnique> { public: - explicit ReturnUnique(InstantiationData const & data): Plugin(data) {} + explicit ReturnUnique(InstantiationData const & data): FilteringPlugin(data) {} void run() override { if (compiler.getLangOpts().CPlusPlus) { diff --git a/compilerplugins/clang/store/revisibility.cxx b/compilerplugins/clang/store/revisibility.cxx index fec8ff7f7e61..9aa04f7b2560 100644 --- a/compilerplugins/clang/store/revisibility.cxx +++ b/compilerplugins/clang/store/revisibility.cxx @@ -26,10 +26,10 @@ bool isFriendDecl(Decl const * decl) { } class ReVisibility: - public RecursiveASTVisitor<ReVisibility>, public loplugin::Plugin + public loplugin::FilteringPlugin<ReVisibility> { public: - explicit ReVisibility(InstantiationData const & data): Plugin(data) {} + explicit ReVisibility(InstantiationData const & data): FilteringPlugin(data) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/store/rtlconstasciimacro.cxx b/compilerplugins/clang/store/rtlconstasciimacro.cxx index eb955e2b4590..66e202ce266f 100644 --- a/compilerplugins/clang/store/rtlconstasciimacro.cxx +++ b/compilerplugins/clang/store/rtlconstasciimacro.cxx @@ -24,9 +24,8 @@ namespace loplugin { class RtlConstAsciiMacro - : public RecursiveASTVisitor< RtlConstAsciiMacro > + : public loplugin::FilteringRewritePlugin< RtlConstAsciiMacro > , public PPCallbacks - , public RewritePlugin { public: explicit RtlConstAsciiMacro( const InstantiationData& data ); @@ -44,7 +43,7 @@ class RtlConstAsciiMacro }; RtlConstAsciiMacro::RtlConstAsciiMacro( const InstantiationData& data ) - : RewritePlugin( data ) + : FilteringRewritePlugin( data ) , searchingForString( false ) { compiler.getPreprocessor().addPPCallbacks( this ); diff --git a/compilerplugins/clang/store/stdexception.cxx b/compilerplugins/clang/store/stdexception.cxx index 85a589f7abdd..47a7d579118a 100644 --- a/compilerplugins/clang/store/stdexception.cxx +++ b/compilerplugins/clang/store/stdexception.cxx @@ -23,10 +23,10 @@ bool isStdException(QualType type) { } class StdException: - public RecursiveASTVisitor<StdException>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<StdException> { public: - explicit StdException(InstantiationData const & data): RewritePlugin(data) + explicit StdException(InstantiationData const & data): FilteringRewritePlugin(data) {} virtual void run() override diff --git a/compilerplugins/clang/store/svstreamoutputoperators.cxx b/compilerplugins/clang/store/svstreamoutputoperators.cxx index dcabbf5df3bb..6e0ff616844d 100644 --- a/compilerplugins/clang/store/svstreamoutputoperators.cxx +++ b/compilerplugins/clang/store/svstreamoutputoperators.cxx @@ -33,8 +33,7 @@ namespace loplugin { class SvStreamOutputOperators - : public RecursiveASTVisitor< SvStreamOutputOperators > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< SvStreamOutputOperators > { public: explicit SvStreamOutputOperators( InstantiationData const & data ); @@ -45,7 +44,7 @@ class SvStreamOutputOperators }; SvStreamOutputOperators::SvStreamOutputOperators( InstantiationData const & data ) - : RewritePlugin( data ) + : FilteringRewritePlugin( data ) { } diff --git a/compilerplugins/clang/store/tutorial/tutorial1.cxx b/compilerplugins/clang/store/tutorial/tutorial1.cxx index cd3f710d1187..0b73431fbbad 100644 --- a/compilerplugins/clang/store/tutorial/tutorial1.cxx +++ b/compilerplugins/clang/store/tutorial/tutorial1.cxx @@ -22,7 +22,7 @@ namespace loplugin // Ctor, nothing special, pass the argument(s). Tutorial1::Tutorial1( const InstantiationData& data ) - : Plugin( data ) + : FilteringPlugin( data ) { } diff --git a/compilerplugins/clang/store/tutorial/tutorial1.hxx b/compilerplugins/clang/store/tutorial/tutorial1.hxx index 365d9259680c..59f115147780 100644 --- a/compilerplugins/clang/store/tutorial/tutorial1.hxx +++ b/compilerplugins/clang/store/tutorial/tutorial1.hxx @@ -20,9 +20,7 @@ namespace loplugin // The class implementing the plugin action. class Tutorial1 // Inherits from the Clang class that will allow examing the Clang AST tree (i.e. syntax tree). - : public RecursiveASTVisitor< Tutorial1 > - // And the base class for LO Clang plugins. - , public Plugin + : public FilteringPlugin< Tutorial1 > { public: // Ctor, nothing special. diff --git a/compilerplugins/clang/store/tutorial/tutorial2.cxx b/compilerplugins/clang/store/tutorial/tutorial2.cxx index 5d3a2d6322e5..8ef338c6d5f8 100644 --- a/compilerplugins/clang/store/tutorial/tutorial2.cxx +++ b/compilerplugins/clang/store/tutorial/tutorial2.cxx @@ -23,7 +23,7 @@ namespace loplugin { Tutorial2::Tutorial2( const InstantiationData& data ) - : Plugin( data ) + : FilteringPlugin( data ) { } diff --git a/compilerplugins/clang/store/tutorial/tutorial2.hxx b/compilerplugins/clang/store/tutorial/tutorial2.hxx index cb708d32cef8..9c1f486f80e0 100644 --- a/compilerplugins/clang/store/tutorial/tutorial2.hxx +++ b/compilerplugins/clang/store/tutorial/tutorial2.hxx @@ -19,8 +19,7 @@ namespace loplugin // The same like for Tutorial1. class Tutorial2 - : public RecursiveASTVisitor< Tutorial2 > - , public Plugin + : public FilteringPlugin< Tutorial2 > { public: Tutorial2( const InstantiationData& data ); diff --git a/compilerplugins/clang/store/tutorial/tutorial3.cxx b/compilerplugins/clang/store/tutorial/tutorial3.cxx index 183c3b20d40c..e48118611eb7 100644 --- a/compilerplugins/clang/store/tutorial/tutorial3.cxx +++ b/compilerplugins/clang/store/tutorial/tutorial3.cxx @@ -23,7 +23,7 @@ namespace loplugin // Ctor, pass arguments. Tutorial3::Tutorial3( const InstantiationData& data ) - : RewritePlugin( data ) + : FilteringRewritePlugin( data ) { } diff --git a/compilerplugins/clang/store/tutorial/tutorial3.hxx b/compilerplugins/clang/store/tutorial/tutorial3.hxx index 4261d1bfd7f0..badb12904cf2 100644 --- a/compilerplugins/clang/store/tutorial/tutorial3.hxx +++ b/compilerplugins/clang/store/tutorial/tutorial3.hxx @@ -19,8 +19,7 @@ namespace loplugin // Similar like for Tutorial2, but this time the base class is RewritePlugin. class Tutorial3 - : public RecursiveASTVisitor< Tutorial3 > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< Tutorial3 > { public: // One more argument for ctor. diff --git a/compilerplugins/clang/store/unusedcode.cxx b/compilerplugins/clang/store/unusedcode.cxx index 09fc71b3fcc5..32fc4d3c2d7b 100644 --- a/compilerplugins/clang/store/unusedcode.cxx +++ b/compilerplugins/clang/store/unusedcode.cxx @@ -25,8 +25,7 @@ namespace loplugin { class UnusedCode - : public RecursiveASTVisitor< UnusedCode > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< UnusedCode > { public: explicit UnusedCode( CompilerInstance& compiler, Rewriter& rewriter ); @@ -35,7 +34,7 @@ class UnusedCode }; UnusedCode::UnusedCode( CompilerInstance& compiler, Rewriter& rewriter ) - : RewritePlugin( compiler, rewriter ) + : FilteringRewritePlugin( compiler, rewriter ) { } diff --git a/compilerplugins/clang/store/valueof.cxx b/compilerplugins/clang/store/valueof.cxx index 63dfa2f0c2bc..2b769a3e8cac 100644 --- a/compilerplugins/clang/store/valueof.cxx +++ b/compilerplugins/clang/store/valueof.cxx @@ -22,8 +22,7 @@ namespace loplugin { class ConvertValueOf - : public RecursiveASTVisitor< ConvertValueOf > - , public RewritePlugin + : public loplugin::FilteringRewritePlugin< ConvertValueOf > { public: explicit ConvertValueOf( CompilerInstance& compiler, Rewriter& rewriter ); @@ -34,7 +33,7 @@ class ConvertValueOf }; ConvertValueOf::ConvertValueOf( CompilerInstance& compiler, Rewriter& rewriter ) - : RewritePlugin( compiler, rewriter ) + : FilteringRewritePlugin( compiler, rewriter ) { } diff --git a/compilerplugins/clang/stringconcat.cxx b/compilerplugins/clang/stringconcat.cxx index 43300fba5656..caa8e61ddedb 100644 --- a/compilerplugins/clang/stringconcat.cxx +++ b/compilerplugins/clang/stringconcat.cxx @@ -42,11 +42,11 @@ Expr const * stripCtor(Expr const * expr) { } class StringConcat: - public RecursiveASTVisitor<StringConcat>, public loplugin::Plugin + public loplugin::FilteringPlugin<StringConcat> { public: explicit StringConcat(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index a8914ff5385f..c33ff2cc2d8f 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -102,11 +102,11 @@ char const * adviseNonArray(bool nonArray) { } class StringConstant: - public RecursiveASTVisitor<StringConstant>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<StringConstant> { public: explicit StringConstant(loplugin::InstantiationData const & data): - RewritePlugin(data) {} + FilteringRewritePlugin(data) {} void run() override; diff --git a/compilerplugins/clang/unreffun.cxx b/compilerplugins/clang/unreffun.cxx index 629e369dadc7..04c4e9f95dc1 100644 --- a/compilerplugins/clang/unreffun.cxx +++ b/compilerplugins/clang/unreffun.cxx @@ -64,9 +64,9 @@ bool isSpecialMemberFunction(FunctionDecl const * decl) { return false; } -class UnrefFun: public RecursiveASTVisitor<UnrefFun>, public loplugin::Plugin { +class UnrefFun: public loplugin::FilteringPlugin<UnrefFun> { public: - explicit UnrefFun(loplugin::InstantiationData const & data): Plugin(data) {} + explicit UnrefFun(loplugin::InstantiationData const & data): FilteringPlugin(data) {} void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/unusedfields.cxx b/compilerplugins/clang/unusedfields.cxx index 389baac0dc9b..ac8a4d1aabf2 100644 --- a/compilerplugins/clang/unusedfields.cxx +++ b/compilerplugins/clang/unusedfields.cxx @@ -136,11 +136,11 @@ public: }; class UnusedFields: - public RecursiveASTVisitor<UnusedFields>, public loplugin::Plugin + public loplugin::FilteringPlugin<UnusedFields> { public: explicit UnusedFields(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override; diff --git a/compilerplugins/clang/unusedfieldsremove.cxx b/compilerplugins/clang/unusedfieldsremove.cxx index 417ced9f3891..62c5fc7bb271 100644 --- a/compilerplugins/clang/unusedfieldsremove.cxx +++ b/compilerplugins/clang/unusedfieldsremove.cxx @@ -28,7 +28,7 @@ namespace { class UnusedFieldsRemove: - public RecursiveASTVisitor<UnusedFieldsRemove>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<UnusedFieldsRemove> { public: explicit UnusedFieldsRemove(loplugin::InstantiationData const & data); @@ -52,7 +52,7 @@ size_t getFilesize(const char* filename) return st.st_size; } -UnusedFieldsRemove::UnusedFieldsRemove(loplugin::InstantiationData const & data): RewritePlugin(data) +UnusedFieldsRemove::UnusedFieldsRemove(loplugin::InstantiationData const & data): FilteringRewritePlugin(data) { static const char sInputFile[] = SRCDIR "/result.txt"; mmapFilesize = getFilesize(sInputFile); diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx index a84b7e8d237d..3837aa6d00ff 100644 --- a/compilerplugins/clang/unusedmethods.cxx +++ b/compilerplugins/clang/unusedmethods.cxx @@ -75,11 +75,11 @@ static std::set<MyFuncInfo> calledFromOutsideSet; class UnusedMethods: - public RecursiveASTVisitor<UnusedMethods>, public loplugin::Plugin + public loplugin::FilteringPlugin<UnusedMethods> { public: explicit UnusedMethods(loplugin::InstantiationData const & data): - Plugin(data) {} + FilteringPlugin(data) {} virtual void run() override { diff --git a/compilerplugins/clang/unusedmethodsremove.cxx b/compilerplugins/clang/unusedmethodsremove.cxx index 4dc3a7be7a51..5fdeefa13a7f 100644 --- a/compilerplugins/clang/unusedmethodsremove.cxx +++ b/compilerplugins/clang/unusedmethodsremove.cxx @@ -29,7 +29,7 @@ namespace { class UnusedMethodsRemove: - public RecursiveASTVisitor<UnusedMethodsRemove>, public loplugin::RewritePlugin + public loplugin::FilteringRewritePlugin<UnusedMethodsRemove> { public: explicit UnusedMethodsRemove(loplugin::InstantiationData const & data); @@ -53,7 +53,7 @@ size_t getFilesize(const char* filename) return st.st_size; } -UnusedMethodsRemove::UnusedMethodsRemove(loplugin::InstantiationData const & data): RewritePlugin(data) +UnusedMethodsRemove::UnusedMethodsRemove(loplugin::InstantiationData const & data): FilteringRewritePlugin(data) { static const char sInputFile[] = SRCDIR "/result.txt"; mmapFilesize = getFilesize(sInputFile); diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx index 32b7cd966940..8200ae8fc3b1 100644 --- a/compilerplugins/clang/unusedvariablecheck.cxx +++ b/compilerplugins/clang/unusedvariablecheck.cxx @@ -34,7 +34,7 @@ that cannot be edited there is a manual list below. */ UnusedVariableCheck::UnusedVariableCheck( const InstantiationData& data ) - : Plugin( data ) + : FilteringPlugin( data ) { } diff --git a/compilerplugins/clang/unusedvariablecheck.hxx b/compilerplugins/clang/unusedvariablecheck.hxx index b3e8467a709e..5e8b59bdc6b0 100644 --- a/compilerplugins/clang/unusedvariablecheck.hxx +++ b/compilerplugins/clang/unusedvariablecheck.hxx @@ -18,8 +18,7 @@ namespace loplugin { class UnusedVariableCheck - : public RecursiveASTVisitor< UnusedVariableCheck > - , public Plugin + : public FilteringPlugin< UnusedVariableCheck > { public: explicit UnusedVariableCheck( const InstantiationData& data ); diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx index 9b50c72ecbd4..6b8e8125daa7 100644 --- a/compilerplugins/clang/vclwidgets.cxx +++ b/compilerplugins/clang/vclwidgets.cxx @@ -26,10 +26,10 @@ namespace { class VCLWidgets: - public RecursiveASTVisitor<VCLWidgets>, public loplugin::Plugin + public loplugin::FilteringPlugin<VCLWidgets> { public: - explicit VCLWidgets(loplugin::InstantiationData const & data): Plugin(data) + explicit VCLWidgets(loplugin::InstantiationData const & data): FilteringPlugin(data) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } |