summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-02-12 17:42:09 +0000
committerFangrui Song <maskray@google.com>2018-02-12 17:42:09 +0000
commit31b97194e65a55b75f10155c7216f0cf9124573e (patch)
treeee3bb710b3cd8cd4deb7301518f462222fe32693 /clang/include/clang-c
parentb0a17edff7f8873a33e304077b7528e2ed09e36b (diff)
downloadbcm5719-llvm-31b97194e65a55b75f10155c7216f0cf9124573e.tar.gz
bcm5719-llvm-31b97194e65a55b75f10155c7216f0cf9124573e.zip
[libclang] Add `CXSymbolRole role` to CXIdxEntityRefInfo
Summary: CXIdxEntityRefInfo contains the member `CXIdxEntityRefKind kind;` to differentiate implicit and direct calls. However, there are more roles defined in SymbolRole. Among them, `Read/Write` are probably the most useful ones as they can be used to differentiate Read/Write occurrences of a symbol for document highlight in a text document. See `export namespace DocumentHighlightKind` on https://microsoft.github.io/language-server-protocol/specification Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42895 llvm-svn: 324914
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index ebbf38975a1..6468d1aa404 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -32,7 +32,7 @@
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 47
+#define CINDEX_VERSION_MINOR 48
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -6092,6 +6092,9 @@ typedef struct {
/**
* \brief Data for IndexerCallbacks#indexEntityReference.
+ *
+ * This may be deprecated in a future version as this duplicates
+ * the \c CXSymbolRole_Implicit bit in \c CXSymbolRole.
*/
typedef enum {
/**
@@ -6106,6 +6109,25 @@ typedef enum {
} CXIdxEntityRefKind;
/**
+ * \brief Roles that are attributed to symbol occurrences.
+ *
+ * Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with
+ * higher bits zeroed. These high bits may be exposed in the future.
+ */
+typedef enum {
+ CXSymbolRole_None = 0,
+ CXSymbolRole_Declaration = 1 << 0,
+ CXSymbolRole_Definition = 1 << 1,
+ CXSymbolRole_Reference = 1 << 2,
+ CXSymbolRole_Read = 1 << 3,
+ CXSymbolRole_Write = 1 << 4,
+ CXSymbolRole_Call = 1 << 5,
+ CXSymbolRole_Dynamic = 1 << 6,
+ CXSymbolRole_AddressOf = 1 << 7,
+ CXSymbolRole_Implicit = 1 << 8
+} CXSymbolRole;
+
+/**
* \brief Data for IndexerCallbacks#indexEntityReference.
*/
typedef struct {
@@ -6135,6 +6157,10 @@ typedef struct {
* \brief Lexical container context of the reference.
*/
const CXIdxContainerInfo *container;
+ /**
+ * \brief Sets of symbol roles of the reference.
+ */
+ CXSymbolRole role;
} CXIdxEntityRefInfo;
/**
OpenPOWER on IntegriCloud