[clang] [ast matcher] add `ExportDecl` in dynamically matchers (PR #118258)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 14:43:11 PST 2024


https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/118258

>From f9fbb478194a429f1879c176504b8596312b9baf Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0907 at 163.com>
Date: Mon, 2 Dec 2024 14:08:47 +0800
Subject: [PATCH 1/2] [ast matcher] add `ExportDecl` in dynamically matchers

---
 clang/lib/ASTMatchers/Dynamic/Registry.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 8d36ad5c80b5d4..8edad28bc2e58f 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -604,6 +604,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(usingDecl);
   REGISTER_MATCHER(usingEnumDecl);
   REGISTER_MATCHER(usingDirectiveDecl);
+  REGISTER_MATCHER(exportDecl);
   REGISTER_MATCHER(valueDecl);
   REGISTER_MATCHER(varDecl);
   REGISTER_MATCHER(variableArrayType);

>From e1e67151b48616d7336f2f58da63923470b3d7a5 Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0907 at 163.com>
Date: Wed, 4 Dec 2024 06:42:50 +0800
Subject: [PATCH 2/2] fix order

---
 clang/lib/ASTMatchers/Dynamic/Registry.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 8edad28bc2e58f..837633fb2f0601 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -243,6 +243,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(equalsBoundNode);
   REGISTER_MATCHER(equalsIntegralValue);
   REGISTER_MATCHER(explicitCastExpr);
+  REGISTER_MATCHER(exportDecl);
   REGISTER_MATCHER(expr);
   REGISTER_MATCHER(exprWithCleanups);
   REGISTER_MATCHER(fieldDecl);
@@ -604,7 +605,6 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(usingDecl);
   REGISTER_MATCHER(usingEnumDecl);
   REGISTER_MATCHER(usingDirectiveDecl);
-  REGISTER_MATCHER(exportDecl);
   REGISTER_MATCHER(valueDecl);
   REGISTER_MATCHER(varDecl);
   REGISTER_MATCHER(variableArrayType);



More information about the cfe-commits mailing list