diff options
| author | Michael Wu <mwu.code@gmail.com> | 2018-08-03 04:38:04 +0000 |
|---|---|---|
| committer | Michael Wu <mwu.code@gmail.com> | 2018-08-03 04:38:04 +0000 |
| commit | 7649e6290667d96ac3070c42fdc840e631fdc17f (patch) | |
| tree | 09a47ed44e7bc9ef7b1cd123da8d1d86a90b2eef /clang/include/clang-c | |
| parent | 153085d6bc7c15e059a32f8223479a8e35d82ee5 (diff) | |
| download | bcm5719-llvm-7649e6290667d96ac3070c42fdc840e631fdc17f.tar.gz bcm5719-llvm-7649e6290667d96ac3070c42fdc840e631fdc17f.zip | |
[libclang 4/8] Add the clang_Type_getNullability() API
Summary:
This patch adds a clang-c API for querying the nullability of an AttributedType.
The test here also tests D49081
Reviewers: yvvan, jbcoe
Reviewed By: yvvan
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49082
llvm-svn: 338809
Diffstat (limited to 'clang/include/clang-c')
| -rw-r--r-- | clang/include/clang-c/Index.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 8e281cab910..712b1efda12 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -3745,6 +3745,33 @@ CINDEX_LINKAGE CXType clang_Type_getNamedType(CXType T); */ CINDEX_LINKAGE unsigned clang_Type_isTransparentTagTypedef(CXType T); +enum CXTypeNullabilityKind { + /** + * Values of this type can never be null. + */ + CXTypeNullability_NonNull = 0, + /** + * Values of this type can be null. + */ + CXTypeNullability_Nullable = 1, + /** + * Whether values of this type can be null is (explicitly) + * unspecified. This captures a (fairly rare) case where we + * can't conclude anything about the nullability of the type even + * though it has been considered. + */ + CXTypeNullability_Unspecified = 2, + /** + * Nullability is not applicable to this type. + */ + CXTypeNullability_Invalid = 3 +}; + +/** + * Retrieve the nullability kind of a pointer type. + */ +CINDEX_LINKAGE enum CXTypeNullabilityKind clang_Type_getNullability(CXType T); + /** * List the possible error codes for \c clang_Type_getSizeOf, * \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and |

