[clang] [cindex] Add API to query the class methods of a type (PR #123539)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 20 07:05:31 PST 2025


================
@@ -6628,6 +6628,29 @@ CINDEX_LINKAGE unsigned clang_visitCXXBaseClasses(CXType T,
                                                   CXFieldVisitor visitor,
                                                   CXClientData client_data);
 
+/**
+ * Visit the class methods of a type.
+ *
+ * This function visits all the methods of the given cursor,
+ * invoking the given \p visitor function with the cursors of each
+ * visited method. The traversal may be ended prematurely, if
+ * the visitor returns \c CXFieldVisit_Break.
+ *
+ * \param T the record type whose field may be visited.
+ *
+ * \param visitor the visitor function that will be invoked for each
+ * field of \p T.
+ *
+ * \param client_data pointer data supplied by the client, which will
+ * be passed to the visitor each time it is invoked.
+ *
+ * \returns a non-zero value if the traversal was terminated
+ * prematurely by the visitor returning \c CXFieldVisit_Break.
----------------
AaronBallman wrote:

```suggestion
 * \param T The record type whose field may be visited.
 *
 * \param visitor The visitor function that will be invoked for each
 * field of \p T.
 *
 * \param client_data Pointer data supplied by the client, which will
 * be passed to the visitor each time it is invoked.
 *
 * \returns A non-zero value if the traversal was terminated
 * prematurely by the visitor returning \c CXFieldVisit_Break.
```

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


More information about the cfe-commits mailing list