[clang] [clang][ExtractAPI] combine typedef records if the underlying type's name is underscored (PR #125964)

via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 6 14:53:25 PST 2025


================
@@ -1146,11 +1146,30 @@ bool ExtractAPIVisitorBase<Derived>::VisitTypedefNameDecl(
 
   StringRef Name = Decl->getName();
 
+  auto nameMatches = [&Name](TagDecl *TagDecl) {
+    StringRef TagName = TagDecl->getName();
+
+    if (TagName == Name)
+      return true;
+
+    // Also check whether the tag decl's name is the same as the typedef name
+    // with prefixed underscores
+    if (TagName.starts_with('_')) {
+      StringRef StrippedName =
+          TagName.drop_while([](char c) { return c == '_'; });
----------------
QuietMisdreavus wrote:

I knew i was missing a simpler option! Thanks for the pointer; i've pushed up a new commit that swaps it out.

https://github.com/llvm/llvm-project/pull/125964


More information about the cfe-commits mailing list