diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-16 08:13:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-16 09:15:01 +0200 |
commit | 8d4fbc532e2058a906b06471501385404ff31541 (patch) | |
tree | f6e0116d76e605395bc05444e2eece0574da9ba2 /compilerplugins/clang/unoquery.cxx | |
parent | 5521ac4e152dc9159ac7f7d86d9d2addef443cf4 (diff) |
convert some plugins to LO_CLANG_SHARED_PLUGINS
Change-Id: I7451a95377101004c7c53c918f3234415e06f555
Reviewed-on: https://gerrit.libreoffice.org/75670
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/unoquery.cxx')
-rw-r--r-- | compilerplugins/clang/unoquery.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/compilerplugins/clang/unoquery.cxx b/compilerplugins/clang/unoquery.cxx index d445aa250623..82427555fef9 100644 --- a/compilerplugins/clang/unoquery.cxx +++ b/compilerplugins/clang/unoquery.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef LO_CLANG_SHARED_PLUGINS + #include "check.hxx" #include "plugin.hxx" @@ -24,7 +26,16 @@ public: { } - void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + bool preRun() override { return compiler.getLangOpts().CPlusPlus; } + + void run() override + { + if (preRun()) + { + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } + } + bool VisitCXXMemberCallExpr(CXXMemberCallExpr const*); }; @@ -79,7 +90,10 @@ bool UnoQuery::VisitCXXMemberCallExpr(CXXMemberCallExpr const* memberCallExpr) return true; } -loplugin::Plugin::Registration<UnoQuery> unoquery("unoquery", true); -}; +loplugin::Plugin::Registration<UnoQuery> unoquery("unoquery"); + +} // namespace + +#endif // LO_CLANG_SHARED_PLUGINS /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |