summaryrefslogtreecommitdiff
path: root/removeFunctionCall.cpp
diff options
context:
space:
mode:
authorAotrix <[email protected]>2026-09-14 23:59:19 +0200
committerAotrix <[email protected]>2026-09-15 00:01:07 +0200
commit3b441e77a5cd9eff9939e4c8e4a31a4f8f2845a2 (patch)
treead7b20c7dbd57c2a2b670532736ef885f4c80175 /removeFunctionCall.cpp
parent134538c78f1469c96d8ea6fef88f3457ec3b4af8 (diff)
Added custom matcher
Diffstat (limited to 'removeFunctionCall.cpp')
-rw-r--r--removeFunctionCall.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/removeFunctionCall.cpp b/removeFunctionCall.cpp
index 1270603..b60070d 100644
--- a/removeFunctionCall.cpp
+++ b/removeFunctionCall.cpp
@@ -35,6 +35,7 @@
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
+#include "clang/ASTMatchers/ASTMatchersMacros.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
@@ -69,6 +70,23 @@ using ::clang::transformer::member;
using ::clang::transformer::name;
using ::clang::transformer::node;
+namespace clang
+{
+namespace ast_matchers
+{
+namespace
+{
+AST_MATCHER_P(MemberExpr,
+ Member,
+ clang::ast_matchers::internal::Matcher<ValueDecl>,
+ InnerMatcher)
+{
+ return InnerMatcher.matches(*Node.getMemberDecl(), Finder, Builder);
+}
+} // namespace
+} // namespace ast_matchers
+} // namespace clang
+
bool applySourceChanges(const AtomicChanges& Replacements)
{
std::set<std::string> Files;