summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/bindings/python/clang/cindex.py3
-rw-r--r--clang/include/clang-c/Index.h7
-rw-r--r--clang/test/Index/attributes.c10
-rw-r--r--clang/tools/libclang/CIndex.cpp6
-rw-r--r--clang/tools/libclang/CXCursor.cpp3
5 files changed, 27 insertions, 2 deletions
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 21c3f9a8f38..81b2f3f6050 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -1079,6 +1079,9 @@ CursorKind.CXX_OVERRIDE_ATTR = CursorKind(405)
CursorKind.ANNOTATE_ATTR = CursorKind(406)
CursorKind.ASM_LABEL_ATTR = CursorKind(407)
CursorKind.PACKED_ATTR = CursorKind(408)
+CursorKind.PURE_ATTR = CursorKind(409)
+CursorKind.CONST_ATTR = CursorKind(410)
+CursorKind.NODUPLICATE_ATTR = CursorKind(411)
###
# Preprocessing
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 8393c6b7d47..87b1f432fa5 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 25
+#define CINDEX_VERSION_MINOR 26
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -2165,7 +2165,10 @@ enum CXCursorKind {
CXCursor_AnnotateAttr = 406,
CXCursor_AsmLabelAttr = 407,
CXCursor_PackedAttr = 408,
- CXCursor_LastAttr = CXCursor_PackedAttr,
+ CXCursor_PureAttr = 409,
+ CXCursor_ConstAttr = 410,
+ CXCursor_NoDuplicateAttr = 411,
+ CXCursor_LastAttr = CXCursor_NoDuplicateAttr,
/* Preprocessing */
CXCursor_PreprocessingDirective = 500,
diff --git a/clang/test/Index/attributes.c b/clang/test/Index/attributes.c
index 3e60e6c0e49..95d9c7548bd 100644
--- a/clang/test/Index/attributes.c
+++ b/clang/test/Index/attributes.c
@@ -4,7 +4,17 @@ struct __attribute__((packed)) Test2 {
char a;
};
+void pure_fn() __attribute__((pure));
+void const_fn() __attribute__((const));
+void noduplicate_fn() __attribute__((noduplicate));
+
// CHECK: attributes.c:3:32: StructDecl=Test2:3:32 (Definition) Extent=[3:1 - 5:2]
// CHECK: attributes.c:3:23: attribute(packed)=packed Extent=[3:23 - 3:29]
// CHECK: attributes.c:4:8: FieldDecl=a:4:8 (Definition) Extent=[4:3 - 4:9] [access=public]
+// CHECK: attributes.c:7:6: FunctionDecl=pure_fn:7:6 Extent=[7:1 - 7:37]
+// CHECK: attributes.c:7:31: attribute(pure)= Extent=[7:31 - 7:35]
+// CHECK: attributes.c:8:6: FunctionDecl=const_fn:8:6 Extent=[8:1 - 8:39]
+// CHECK: attributes.c:8:32: attribute(const)= Extent=[8:32 - 8:37]
+// CHECK: attributes.c:9:6: FunctionDecl=noduplicate_fn:9:6 Extent=[9:1 - 9:51]
+// CHECK: attributes.c:9:38: attribute(noduplicate)= Extent=[9:38 - 9:49]
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 26b3bf16af2..5191dbfa9b7 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3867,6 +3867,12 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {
return cxstring::createRef("asm label");
case CXCursor_PackedAttr:
return cxstring::createRef("attribute(packed)");
+ case CXCursor_PureAttr:
+ return cxstring::createRef("attribute(pure)");
+ case CXCursor_ConstAttr:
+ return cxstring::createRef("attribute(const)");
+ case CXCursor_NoDuplicateAttr:
+ return cxstring::createRef("attribute(noduplicate)");
case CXCursor_PreprocessingDirective:
return cxstring::createRef("preprocessing directive");
case CXCursor_MacroDefinition:
diff --git a/clang/tools/libclang/CXCursor.cpp b/clang/tools/libclang/CXCursor.cpp
index d682986b3f3..fb4ce66d3ac 100644
--- a/clang/tools/libclang/CXCursor.cpp
+++ b/clang/tools/libclang/CXCursor.cpp
@@ -50,6 +50,9 @@ static CXCursorKind GetCursorKind(const Attr *A) {
case attr::Annotate: return CXCursor_AnnotateAttr;
case attr::AsmLabel: return CXCursor_AsmLabelAttr;
case attr::Packed: return CXCursor_PackedAttr;
+ case attr::Pure: return CXCursor_PureAttr;
+ case attr::Const: return CXCursor_ConstAttr;
+ case attr::NoDuplicate: return CXCursor_NoDuplicateAttr;
}
return CXCursor_UnexposedAttr;
OpenPOWER on IntegriCloud