summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/simplifyconstruct.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/simplifyconstruct.cxx')
-rw-r--r--compilerplugins/clang/simplifyconstruct.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/compilerplugins/clang/simplifyconstruct.cxx b/compilerplugins/clang/simplifyconstruct.cxx
index b48764302eae..652a980cec6a 100644
--- a/compilerplugins/clang/simplifyconstruct.cxx
+++ b/compilerplugins/clang/simplifyconstruct.cxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifndef LO_CLANG_SHARED_PLUGINS
+
#include <memory>
#include <cassert>
#include <string>
@@ -34,6 +36,10 @@ public:
bool TraverseReturnStmt(ReturnStmt*) { return true; }
bool TraverseInitListExpr(InitListExpr*) { return true; }
bool TraverseCXXBindTemporaryExpr(CXXBindTemporaryExpr*) { return true; }
+ // ignore them for the shared visitor too
+ bool PreTraverseReturnStmt(ReturnStmt*) { return false; }
+ bool PreTraverseInitListExpr(InitListExpr*) { return false; }
+ bool PreTraverseCXXBindTemporaryExpr(CXXBindTemporaryExpr*) { return false; }
};
bool SimplifyConstruct::VisitCXXConstructExpr(CXXConstructExpr const* constructExpr)
@@ -63,7 +69,9 @@ bool SimplifyConstruct::VisitCXXConstructExpr(CXXConstructExpr const* constructE
return true;
}
-loplugin::Plugin::Registration<SimplifyConstruct> X("simplifyconstruct", true);
+loplugin::Plugin::Registration<SimplifyConstruct> simplifyconstruct("simplifyconstruct", true);
}
+#endif // LO_CLANG_SHARED_PLUGINS
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */