summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/dllprivate.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-17 15:06:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-17 19:32:43 +0200
commitdd969ad6e006adb4a9585c0d1b3378f29bbe5787 (patch)
treea4f479f3f7170205c075e5ce6837949b41acc604 /compilerplugins/clang/dllprivate.cxx
parent7598810d6372bac07e503728ee28c4600a1c9b5d (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/dllprivate.cxx')
-rw-r--r--compilerplugins/clang/dllprivate.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/compilerplugins/clang/dllprivate.cxx b/compilerplugins/clang/dllprivate.cxx
index 8d0f221c327c..5fbace1010b7 100644
--- a/compilerplugins/clang/dllprivate.cxx
+++ b/compilerplugins/clang/dllprivate.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 "plugin.hxx"
@@ -57,24 +58,29 @@ public:
return true;
}
-private:
- void run() override {
+ bool preRun() override {
// DISABLE_DYNLOADING makes SAL_DLLPUBLIC_{EXPORT,IMPORT,TEMPLATE} expand
// to visibility("hidden") attributes, which would cause bogus warnings
// here (e.g., in UBSan builds that explicitly define DISABLE_DYNLOADING
// in jurt/source/pipe/staticsalhack.cxx); alternatively, change
// include/sal/types.h to make those SAL_DLLPUBLIC_* expand to nothing
// for DISABLE_DYNLOADING:
- if (!compiler.getPreprocessor().getIdentifierInfo("DISABLE_DYNLOADING")
- ->hasMacroDefinition())
- {
+ return !compiler.getPreprocessor().getIdentifierInfo("DISABLE_DYNLOADING")
+ ->hasMacroDefinition();
+ }
+
+ void run() override {
+ if (preRun()) {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
}
};
-static loplugin::Plugin::Registration<DllPrivate> reg("dllprivate");
+static loplugin::Plugin::Registration<DllPrivate> dllprivate("dllprivate");
+
+} // namespace
+
+#endif // LO_CLANG_SHARED_PLUGINS
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */