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>
This commit is contained in:
Noel Grandin
2018-08-13 17:24:26 +02:00
parent 4917430c1c
commit 9f4d23c151
75 changed files with 152 additions and 149 deletions

View File

@@ -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);