summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/stringconstant.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 18:18:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 18:18:57 +0200
commit574db10513be6b25f24c8cab49cbc9e63aca87d3 (patch)
treef56f03a03a935daf09adf5c7a8540b12d37e6a29 /compilerplugins/clang/stringconstant.cxx
parent48480d4f19d2fb92ca4ae0527eec4753cdc439c0 (diff)
Revert "convert some plugins to use the sharedplugin infrastructure"
This reverts commit fc1b213d157afa57704cec5a0fb65ae8c11d7822. I didn't convert these correctly, the Traverse calls need adjusting.
Diffstat (limited to 'compilerplugins/clang/stringconstant.cxx')
-rw-r--r--compilerplugins/clang/stringconstant.cxx21
1 files changed, 7 insertions, 14 deletions
diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx
index 29ff508e8c7c..05cfa03ff711 100644
--- a/compilerplugins/clang/stringconstant.cxx
+++ b/compilerplugins/clang/stringconstant.cxx
@@ -7,8 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef LO_CLANG_SHARED_PLUGINS
-
#include <algorithm>
#include <cassert>
#include <cstdint>
@@ -110,8 +108,6 @@ public:
explicit StringConstant(loplugin::InstantiationData const & data):
FilteringRewritePlugin(data) {}
- bool preRun() override;
-
void run() override;
bool TraverseCallExpr(CallExpr * expr);
@@ -190,15 +186,14 @@ private:
std::stack<Expr const *> calls_;
};
-bool StringConstant::preRun() {
- return compiler.getLangOpts().CPlusPlus
+void StringConstant::run() {
+ if (compiler.getLangOpts().CPlusPlus
&& compiler.getPreprocessor().getIdentifierInfo(
- "LIBO_INTERNAL_ONLY")->hasMacroDefinition();
+ "LIBO_INTERNAL_ONLY")->hasMacroDefinition())
//TODO: some parts of it are useful for external code, too
-}
-void StringConstant::run() {
- if (preRun())
+ {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+ }
}
bool StringConstant::TraverseCallExpr(CallExpr * expr) {
@@ -2092,10 +2087,8 @@ void StringConstant::handleFunArgOstring(
}
}
-loplugin::Plugin::Registration< StringConstant > stringconstant("stringconstant");
+loplugin::Plugin::Registration< StringConstant > X("stringconstant", true);
-} // namespace
-
-#endif // LO_CLANG_SHARED_PLUGINS
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */