loplugin:staticvar in various

looks for variables that can be declared const and static i.e. they can
be stored in the read-only linker segment and shared between different
processes

Change-Id: I8ddc6e5fa0f6b10d80c75d5952df8ddd311cf892
Reviewed-on: https://gerrit.libreoffice.org/61591
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-10-09 16:27:11 +02:00
parent 78490b45c7
commit 76dd28afc9
17 changed files with 115 additions and 116 deletions

View File

@@ -76,7 +76,10 @@ public:
// aHTMLOptionTab is ordered by useful grouping, so let it sort at runtime
|| fn == SRCDIR "/svtools/source/svhtml/htmlkywd.cxx"
// TODO sorting some of these tables will be a lot of work...
|| fn == SRCDIR "/sw/source/filter/ww8/ww8par6.cxx")
|| fn == SRCDIR "/sw/source/filter/ww8/ww8par6.cxx"
// this only triggers on older versions of clang, not sure why
// in any case, it is actually about the array in vcl/inc/units.hrc, which we can't change
|| fn == SRCDIR "/vcl/source/app/svdata.cxx")
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
@@ -198,7 +201,7 @@ bool StaticVar::VisitVarDecl(VarDecl const* varDecl)
return true;
}
loplugin::Plugin::Registration<StaticVar> X("staticvar", false);
loplugin::Plugin::Registration<StaticVar> X("staticvar", true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */