This patch adds support to the clang-c API for identifying ObjCObjects in CXTypes, enumerating type args and protocols on ObjCObjectTypes, and retrieving the base type of ObjCObjectTypes. Currently only ObjCInterfaceTypes are exposed, which do not have type args or protocols.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang-c/Index.h | ||
---|---|---|
35 ↗ | (On Diff #154540) | Please, increment the minor version (you are adding new functions) |
3644 ↗ | (On Diff #154540) | Other similar calls usually return unsigned int because they can't be below zero. |
3659 ↗ | (On Diff #154540) | same about return type |
tools/libclang/CXType.cpp | ||
1118 ↗ | (On Diff #154540) | there's no reason to return -1 since in your code you check that the result is greater than 0. |
include/clang-c/Index.h | ||
---|---|---|
35 ↗ | (On Diff #154540) | This is one in a series of patches that add features to libclang - would you be ok with incrementing at the end of the series? |
3644 ↗ | (On Diff #154540) | I was mimicking clang_Type_getNumTemplateArguments for this, which appears to be the most similar API. It uses 0 to n for the number of template arguments and -1 to indicate that it was called on the wrong type. If you're ok with the inconsistency, I'll make this unsigned. I also prefer having this unsigned. |
clang_Type_getNumObjCTypeArgs and clang_Type_getNumObjCProtocolRefs now return unsigned.
I've bumped CINDEX_VERSION_MINOR in D49635 , which is the last in this patch series.