summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unicodetochar.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 12:14:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 15:48:48 +0200
commitfc1b213d157afa57704cec5a0fb65ae8c11d7822 (patch)
tree11fbfeed38a93ee33535449c85964492e60256c9 /compilerplugins/clang/unicodetochar.cxx
parentfd55c09ebab3827847d69112a8786a3413d42db2 (diff)
convert some plugins to use the sharedplugin infrastructure
Change-Id: I690d9df436abdadc51a6d3f7df686a2e37f79f73 Reviewed-on: https://gerrit.libreoffice.org/75624 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/unicodetochar.cxx')
-rw-r--r--compilerplugins/clang/unicodetochar.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/compilerplugins/clang/unicodetochar.cxx b/compilerplugins/clang/unicodetochar.cxx
index e1e381ad2c71..14a59e35f462 100644
--- a/compilerplugins/clang/unicodetochar.cxx
+++ b/compilerplugins/clang/unicodetochar.cxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifndef LO_CLANG_SHARED_PLUGINS
+
#include <stack>
#include "check.hxx"
@@ -72,18 +74,24 @@ public:
return true;
}
-private:
+ bool preRun() override {
+ return compiler.getLangOpts().CPlusPlus;
+ }
+
void run() override {
- if (compiler.getLangOpts().CPlusPlus) {
+ if (preRun()) {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
}
+private:
std::stack<Expr const *> subExprs_;
};
-static loplugin::Plugin::Registration<UnicodeToChar> reg("unicodetochar");
+static loplugin::Plugin::Registration<UnicodeToChar> unicodetochar("unicodetochar");
+
+} // namespace
-}
+#endif // LO_CLANG_SHARED_PLUGINS
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */