diff options
Diffstat (limited to 'compilerplugins/clang/salunicodeliteral.cxx')
-rw-r--r-- | compilerplugins/clang/salunicodeliteral.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/compilerplugins/clang/salunicodeliteral.cxx b/compilerplugins/clang/salunicodeliteral.cxx index cfa37396b02b..bdf83694b77e 100644 --- a/compilerplugins/clang/salunicodeliteral.cxx +++ b/compilerplugins/clang/salunicodeliteral.cxx @@ -6,7 +6,6 @@ * 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 "check.hxx" #include "plugin.hxx" @@ -42,18 +41,16 @@ public: return true; } - bool preRun() override { - return compiler.getLangOpts().CPlusPlus - && compiler.getPreprocessor().getIdentifierInfo( - "LIBO_INTERNAL_ONLY")->hasMacroDefinition(); - } - +private: void run() override { - if (preRun()) + if (compiler.getLangOpts().CPlusPlus + && compiler.getPreprocessor().getIdentifierInfo( + "LIBO_INTERNAL_ONLY")->hasMacroDefinition()) + { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } } -private: void check(ExplicitCastExpr const * expr) { if (ignoreLocation(expr) || isInUnoIncludeFile(expr->getExprLoc())) @@ -93,11 +90,9 @@ private: } }; -static loplugin::Plugin::Registration<SalUnicodeLiteral> salunicodeliteral( +static loplugin::Plugin::Registration<SalUnicodeLiteral> reg( "salunicodeliteral"); -} // namespace - -#endif // LO_CLANG_SHARED_PLUGINS +} /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |