summaryrefslogtreecommitdiff
path: root/include/clang-c
diff options
context:
space:
mode:
authorIvan Donchevskii <yv.ivan@gmail.com>2019-04-29 13:44:07 +0000
committerIvan Donchevskii <yv.ivan@gmail.com>2019-04-29 13:44:07 +0000
commit44566ab1c4af8ad6a51c035f6440197a0ff0c7ee (patch)
treeb28e5aa5b7dfe2999f8b4eacabdc191e5b97c5a7 /include/clang-c
parentec2a7351eae3c202f9509754724ab877380b1b42 (diff)
downloadclang-44566ab1c4af8ad6a51c035f6440197a0ff0c7ee.tar.gz
[libclang] Restore old clang_Cursor_isAnonymous behaviour
D54996 Changed the behaviour of clang_Cursor_isAnonymous, but there is no alternative available to get the old behaviour in some cases, which is essential for determining if a record is syntactically accessible, e.g. struct { int x; int y; } foo; struct { struct { int x; int y; }; } bar; void fun(struct { int x; int y; } *param); The only 'anonymous' struct here is the one nested in bar, since there is no way to reference the struct itself, only the fields within. Though the anonymity applies to the instance itself, not the type. To avoid confusion, I have added a new function called clang_Cursor_isAnonymousRecordDecl which has the old behaviour of clang_Cursor_isAnonymous (and updated the doc for the latter as well, which was seemingly forgotten). Patch by Jorn Vernee. Differential Revision: https://reviews.llvm.org/D61232 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r--include/clang-c/Index.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 4f2f521f92..24b865cbaf 100644
--- a/include/clang-c/Index.h
+++ b/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 55
+#define CINDEX_VERSION_MINOR 56
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -3921,10 +3921,16 @@ CINDEX_LINKAGE CXType clang_Type_getModifiedType(CXType T);
CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField(CXCursor C);
/**
+ * Determine whether the given cursor represents an anonymous
+ * tag or namespace
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C);
+
+/**
* Determine whether the given cursor represents an anonymous record
* declaration.
*/
-CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C);
+CINDEX_LINKAGE unsigned clang_Cursor_isAnonymousRecordDecl(CXCursor C);
enum CXRefQualifierKind {
/** No ref-qualifier was provided. */