diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-16 13:05:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-16 21:31:22 +0200 |
commit | 40fc30d05d9cce7ce7a9cdcb718dcb0f0aab8ac7 (patch) | |
tree | c856f18770e4183bdaff9760124d96a464e84ce6 /compilerplugins/clang/pointerbool.cxx | |
parent | 70c6651e02c4582d66d8e1c1286406c4f01a7d4b (diff) |
convert some plugins to LO_CLANG_SHARED_PLUGINS
Change-Id: I63c9e010d83c24e18a36164ceb0441e48b757142
Reviewed-on: https://gerrit.libreoffice.org/75725
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/pointerbool.cxx')
-rw-r--r-- | compilerplugins/clang/pointerbool.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/compilerplugins/clang/pointerbool.cxx b/compilerplugins/clang/pointerbool.cxx index a3ed40506b8b..66c6a04b3697 100644 --- a/compilerplugins/clang/pointerbool.cxx +++ b/compilerplugins/clang/pointerbool.cxx @@ -20,6 +20,7 @@ /** Look for calls where the param is bool but the call-site-arg is pointer. */ +#ifndef LO_CLANG_SHARED_PLUGINS namespace { @@ -31,7 +32,11 @@ public: { } - virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + virtual void run() override + { + if (preRun()) + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } bool VisitCallExpr(CallExpr const*); @@ -117,7 +122,10 @@ llvm::Optional<APSInt> PointerBool::getCallValue(const Expr* arg) return llvm::Optional<APSInt>(); } -loplugin::Plugin::Registration<PointerBool> X("pointerbool", true); -} +loplugin::Plugin::Registration<PointerBool> pointerbool("pointerbool"); + +} // namespace + +#endif // LO_CLANG_SHARED_PLUGINS /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |