summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-03-21 16:56:02 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-03-21 16:56:02 +0000
commit3b25c91a9e7769e3254c27979c833fb7185a9fd0 (patch)
treec9a15ba34b2bd70ae3ce2be9169c861d9a7736f8 /clang/include/clang-c
parent08ebd61a80b3a0c68675a75bdff984fd2b7c6b39 (diff)
downloadbcm5719-llvm-3b25c91a9e7769e3254c27979c833fb7185a9fd0.tar.gz
bcm5719-llvm-3b25c91a9e7769e3254c27979c833fb7185a9fd0.zip
[index/AST] Determine if a typedef shares a name and spelling location with its underlying tag type
In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent', meaning we treat its references as symbols of the underlying tag symbol. Also provide a libclang API to check for such typedefs. llvm-svn: 298392
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index d466fce8515..208da7d0f42 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -3437,6 +3437,16 @@ CINDEX_LINKAGE long long clang_getArraySize(CXType T);
CINDEX_LINKAGE CXType clang_Type_getNamedType(CXType T);
/**
+ * \brief Determine if a typedef is 'transparent' tag.
+ *
+ * A typedef is considered 'transparent' if it shares a name and spelling
+ * location with its underlying tag type, as is the case with the NS_ENUM macro.
+ *
+ * \returns non-zero if transparent and zero otherwise.
+ */
+CINDEX_LINKAGE unsigned clang_Type_isTransparentTagTypedef(CXType T);
+
+/**
* \brief List the possible error codes for \c clang_Type_getSizeOf,
* \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and
* \c clang_Cursor_getOffsetOf.
OpenPOWER on IntegriCloud