diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-17 15:06:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-17 19:32:43 +0200 |
commit | dd969ad6e006adb4a9585c0d1b3378f29bbe5787 (patch) | |
tree | a4f479f3f7170205c075e5ce6837949b41acc604 /compilerplugins/clang/dynexcspec.cxx | |
parent | 7598810d6372bac07e503728ee28c4600a1c9b5d (diff) |
make some plugins used the shared framework
Change-Id: Ie283a4774564f25e0fde8ca35212f92be786d671
Reviewed-on: https://gerrit.libreoffice.org/75785
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/dynexcspec.cxx')
-rw-r--r-- | compilerplugins/clang/dynexcspec.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/compilerplugins/clang/dynexcspec.cxx b/compilerplugins/clang/dynexcspec.cxx index e5e15cb139fc..af733ec4f10f 100644 --- a/compilerplugins/clang/dynexcspec.cxx +++ b/compilerplugins/clang/dynexcspec.cxx @@ -6,6 +6,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef LO_CLANG_SHARED_PLUGINS #include <algorithm> #include <functional> @@ -49,8 +50,12 @@ public: explicit DynExcSpec(loplugin::InstantiationData const & data): FilteringRewritePlugin(data) {} + bool preRun() override { + return compiler.getLangOpts().CPlusPlus; + } + void run() override { - if (compiler.getLangOpts().CPlusPlus) { + if (preRun()) { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } } @@ -172,8 +177,10 @@ private: } }; -loplugin::Plugin::Registration<DynExcSpec> X("dynexcspec", true); +loplugin::Plugin::Registration<DynExcSpec> dynexcspec("dynexcspec"); -} +} // namespace + +#endif // LO_CLANG_SHARED_PLUGINS /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |