diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-10-11 10:45:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-10-11 14:26:44 +0200 |
commit | 948c9c0a313d932d22cf275792077862eb4de334 (patch) | |
tree | bd52b5ab63d4d84a5731429acc12fb5f46f75b55 /compilerplugins | |
parent | 10ba813b349fc7db3a2304ab9d31cccd06039cc6 (diff) |
Use unique class names for better FlameGraph results
...of measuring loplugin performance, when gathering data with perf and all
plugins that used "Visitor" as class name were lumped together. (Cf.
<https://whatofhow.wordpress.com/2016/06/28/plugin-flamed/>.)
Change-Id: Ie482f443faced7469528da4772e735bc2eda596d
Reviewed-on: https://gerrit.libreoffice.org/43324
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/casttovoid.cxx | 12 | ||||
-rw-r--r-- | compilerplugins/clang/dllprivate.cxx | 8 | ||||
-rw-r--r-- | compilerplugins/clang/dyncastvisibility.cxx | 9 | ||||
-rw-r--r-- | compilerplugins/clang/redundantcopy.cxx | 8 | ||||
-rw-r--r-- | compilerplugins/clang/redundantinline.cxx | 9 | ||||
-rw-r--r-- | compilerplugins/clang/salunicodeliteral.cxx | 9 | ||||
-rw-r--r-- | compilerplugins/clang/subtlezeroinit.cxx | 8 | ||||
-rw-r--r-- | compilerplugins/clang/unicodetochar.cxx | 8 |
8 files changed, 37 insertions, 34 deletions
diff --git a/compilerplugins/clang/casttovoid.cxx b/compilerplugins/clang/casttovoid.cxx index 10f1a6556d66..c6fccf07e7ab 100644 --- a/compilerplugins/clang/casttovoid.cxx +++ b/compilerplugins/clang/casttovoid.cxx @@ -43,11 +43,11 @@ Expr const * lookThroughInitListExpr(Expr const * expr) { return expr; } -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class CastToVoid final: + public RecursiveASTVisitor<CastToVoid>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit CastToVoid(InstantiationData const & data): Plugin(data) {} bool TraverseCStyleCastExpr(CStyleCastExpr * expr) { auto const dre = checkCast(expr); @@ -325,13 +325,13 @@ private: DeclRefExpr const * firstConsumption = nullptr; }; - struct CastToVoid { + struct Cast { ExplicitCastExpr const * cast; DeclRefExpr const * sub; }; std::map<VarDecl const *, Usage> vars_; - std::stack<CastToVoid> castToVoid_; + std::stack<Cast> castToVoid_; std::stack<QualType> returnTypes_; void run() override { @@ -490,7 +490,7 @@ private: } }; -static loplugin::Plugin::Registration<Visitor> reg("casttovoid"); +static loplugin::Plugin::Registration<CastToVoid> reg("casttovoid"); } diff --git a/compilerplugins/clang/dllprivate.cxx b/compilerplugins/clang/dllprivate.cxx index 05cf26d7d5d2..3dc54e2fce64 100644 --- a/compilerplugins/clang/dllprivate.cxx +++ b/compilerplugins/clang/dllprivate.cxx @@ -11,11 +11,11 @@ namespace { -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class DllPrivate final: + public RecursiveASTVisitor<DllPrivate>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit DllPrivate(InstantiationData const & data): Plugin(data) {} bool VisitNamedDecl(NamedDecl const * decl) { if (!decl->getLocation().isInvalid()&&ignoreLocation(decl)) { @@ -72,7 +72,7 @@ private: } }; -static loplugin::Plugin::Registration<Visitor> reg("dllprivate"); +static loplugin::Plugin::Registration<DllPrivate> reg("dllprivate"); } diff --git a/compilerplugins/clang/dyncastvisibility.cxx b/compilerplugins/clang/dyncastvisibility.cxx index 8cae22fbe534..e6e1f6eb79df 100644 --- a/compilerplugins/clang/dyncastvisibility.cxx +++ b/compilerplugins/clang/dyncastvisibility.cxx @@ -75,11 +75,11 @@ StringRef vis(Visibility v) { } } -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class DynCastVisibility final: + public RecursiveASTVisitor<DynCastVisibility>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit DynCastVisibility(InstantiationData const & data): Plugin(data) {} bool shouldVisitTemplateInstantiations() const { return true; } @@ -156,7 +156,8 @@ private: } }; -static loplugin::Plugin::Registration<Visitor> reg("dyncastvisibility"); +static loplugin::Plugin::Registration<DynCastVisibility> reg( + "dyncastvisibility"); } diff --git a/compilerplugins/clang/redundantcopy.cxx b/compilerplugins/clang/redundantcopy.cxx index 18190f1eb0e4..b1216689dbb4 100644 --- a/compilerplugins/clang/redundantcopy.cxx +++ b/compilerplugins/clang/redundantcopy.cxx @@ -13,11 +13,11 @@ namespace { -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class RedundantCopy final: + public RecursiveASTVisitor<RedundantCopy>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit RedundantCopy(InstantiationData const & data): Plugin(data) {} bool VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * expr) { if (ignoreLocation(expr)) { @@ -51,7 +51,7 @@ private: } }; -static loplugin::Plugin::Registration<Visitor> reg("redundantcopy"); +static loplugin::Plugin::Registration<RedundantCopy> reg("redundantcopy"); } diff --git a/compilerplugins/clang/redundantinline.cxx b/compilerplugins/clang/redundantinline.cxx index 88c870d75465..8ef9e040a997 100644 --- a/compilerplugins/clang/redundantinline.cxx +++ b/compilerplugins/clang/redundantinline.cxx @@ -13,11 +13,12 @@ namespace { -class Visitor: - public RecursiveASTVisitor<Visitor>, public loplugin::RewritePlugin +class RedundantInline: + public RecursiveASTVisitor<RedundantInline>, public loplugin::RewritePlugin { public: - explicit Visitor(InstantiationData const & data): RewritePlugin(data) {} + explicit RedundantInline(InstantiationData const & data): + RewritePlugin(data) {} void run() override { if (compiler.getLangOpts().CPlusPlus) { @@ -120,7 +121,7 @@ private: } }; -loplugin::Plugin::Registration<Visitor> reg("redundantinline", true); +loplugin::Plugin::Registration<RedundantInline> reg("redundantinline", true); } diff --git a/compilerplugins/clang/salunicodeliteral.cxx b/compilerplugins/clang/salunicodeliteral.cxx index 410a1aba45c9..a095da8267d9 100644 --- a/compilerplugins/clang/salunicodeliteral.cxx +++ b/compilerplugins/clang/salunicodeliteral.cxx @@ -19,11 +19,11 @@ bool isAsciiCharacterLiteral(Expr const * expr) { return false; } -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class SalUnicodeLiteral final: + public RecursiveASTVisitor<SalUnicodeLiteral>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit SalUnicodeLiteral(InstantiationData const & data): Plugin(data) {} bool VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr) { check(expr); @@ -89,7 +89,8 @@ private: } }; -static loplugin::Plugin::Registration<Visitor> reg("salunicodeliteral"); +static loplugin::Plugin::Registration<SalUnicodeLiteral> reg( + "salunicodeliteral"); } diff --git a/compilerplugins/clang/subtlezeroinit.cxx b/compilerplugins/clang/subtlezeroinit.cxx index c6c3486bd8c0..0871dbbabc67 100644 --- a/compilerplugins/clang/subtlezeroinit.cxx +++ b/compilerplugins/clang/subtlezeroinit.cxx @@ -17,11 +17,11 @@ namespace { -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class SubtleZeroInit final: + public RecursiveASTVisitor<SubtleZeroInit>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit SubtleZeroInit(InstantiationData const & data): Plugin(data) {} bool VisitCXXNewExpr(CXXNewExpr const * expr) { if (ignoreLocation(expr)) { @@ -52,7 +52,7 @@ private: } }; -static loplugin::Plugin::Registration<Visitor> reg("subtlezeroinit"); +static loplugin::Plugin::Registration<SubtleZeroInit> reg("subtlezeroinit"); } diff --git a/compilerplugins/clang/unicodetochar.cxx b/compilerplugins/clang/unicodetochar.cxx index 92660a118722..ad25c9b4508e 100644 --- a/compilerplugins/clang/unicodetochar.cxx +++ b/compilerplugins/clang/unicodetochar.cxx @@ -17,11 +17,11 @@ namespace { -class Visitor final: - public RecursiveASTVisitor<Visitor>, public loplugin::Plugin +class UnicodeToChar final: + public RecursiveASTVisitor<UnicodeToChar>, public loplugin::Plugin { public: - explicit Visitor(InstantiationData const & data): Plugin(data) {} + explicit UnicodeToChar(InstantiationData const & data): Plugin(data) {} bool TraverseCStyleCastExpr(CStyleCastExpr * expr) { subExprs_.push(expr->getSubExpr()); @@ -81,7 +81,7 @@ private: std::stack<Expr const *> subExprs_; }; -static loplugin::Plugin::Registration<Visitor> reg("unicodetochar"); +static loplugin::Plugin::Registration<UnicodeToChar> reg("unicodetochar"); } |