diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-13 17:24:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-14 13:02:14 +0200 |
commit | 9f4d23c15115d64febd6bf01f870cc157badd350 (patch) | |
tree | 6bc1724f580291d42d62815d9ba84c7d2245b0ad /compilerplugins/clang/store/tutorial | |
parent | 4917430c1c5e8105987e81d65d31df21955ad60e (diff) |
filter out some of the AST in the plugins
by checking if the current namespace decl is in our code, so we have to
scan less stuff, which results in a 10% perf improvement for me
Change-Id: Idf0e30d57b6d0dcd13daa9ed679c28b9d233d387
Reviewed-on: https://gerrit.libreoffice.org/58942
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/store/tutorial')
6 files changed, 6 insertions, 10 deletions
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. |