aboutsummaryrefslogtreecommitdiff
path: root/include/clang-c/Index.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang-c/Index.h')
-rw-r--r--include/clang-c/Index.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 65d05e5094..05ac19bb23 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -1857,6 +1857,7 @@ enum CXCursorKind {
*/
typedef struct {
enum CXCursorKind kind;
+ int xdata;
void *data[3];
} CXCursor;
@@ -3779,6 +3780,53 @@ CINDEX_LINKAGE void clang_remap_dispose(CXRemapping);
* @}
*/
+/** \defgroup CINDEX_HIGH Higher level API functions
+ *
+ * @{
+ */
+
+enum CXVisitorResult {
+ CXVisit_Break,
+ CXVisit_Continue
+};
+
+typedef struct {
+ void *context;
+ enum CXVisitorResult (*visit)(void *context, CXCursor, CXSourceRange);
+} CXCursorAndRangeVisitor;
+
+/**
+ * \brief Find references of a declaration in a specific file.
+ *
+ * \param cursor pointing to a declaration or a reference of one.
+ *
+ * \param file to search for references.
+ *
+ * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for
+ * each reference found.
+ * The CXSourceRange will point inside the file; if the reference is inside
+ * a macro (and not a macro argument) the CXSourceRange will be invalid.
+ */
+CINDEX_LINKAGE void clang_findReferencesInFile(CXCursor cursor, CXFile file,
+ CXCursorAndRangeVisitor visitor);
+
+#ifdef __has_feature
+# if __has_feature(blocks)
+
+typedef enum CXVisitorResult
+ (^CXCursorAndRangeVisitorBlock)(CXCursor, CXSourceRange);
+
+CINDEX_LINKAGE
+void clang_findReferencesInFileWithBlock(CXCursor, CXFile,
+ CXCursorAndRangeVisitorBlock);
+
+# endif
+#endif
+
+/**
+ * @}
+ */
+
/**
* @}
*/