diff options
Diffstat (limited to 'compilerplugins/clang/dyncastvisibility.cxx')
-rw-r--r-- | compilerplugins/clang/dyncastvisibility.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/compilerplugins/clang/dyncastvisibility.cxx b/compilerplugins/clang/dyncastvisibility.cxx index 8b29f0735ca9..0f6021101e2b 100644 --- a/compilerplugins/clang/dyncastvisibility.cxx +++ b/compilerplugins/clang/dyncastvisibility.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef LO_CLANG_SHARED_PLUGINS + #include <algorithm> #include <cassert> #include <cstddef> @@ -184,17 +186,22 @@ public: return true; } + virtual bool preRun() override { + return compiler.getLangOpts().CPlusPlus; + } private: void run() override { - if (compiler.getLangOpts().CPlusPlus) { + if (preRun()) { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } } }; -static loplugin::Plugin::Registration<DynCastVisibility> reg( +static loplugin::Plugin::Registration<DynCastVisibility> dyncastvisibility( "dyncastvisibility"); } +#endif // LO_CLANG_SHARED_PLUGINS + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |