[PATCH] D49063: [libclang] Add support for ObjCObjectType

Ivan Donchevskii via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 11 23:16:27 PDT 2018


yvvan added inline comments.


================
Comment at: include/clang-c/Index.h:35
 #define CINDEX_VERSION_MAJOR 0
 #define CINDEX_VERSION_MINOR 49
 
----------------
Please, increment the minor version (you are adding new functions)


================
Comment at: include/clang-c/Index.h:3644
+ */
+CINDEX_LINKAGE int clang_Type_getNumObjCProtocolRefs(CXType T);
+
----------------
Other similar calls usually return unsigned int because they can't be below zero.


================
Comment at: include/clang-c/Index.h:3659
+ */
+CINDEX_LINKAGE int clang_Type_getNumObjCTypeArgs(CXType T);
+
----------------
same about return type


================
Comment at: tools/libclang/CXType.cpp:1118
+  if (T.isNull())
+    return -1;
+
----------------
there's no reason to return -1 since in your code you check that the result is greater than 0.
Return 0 instead (this is also related to the comment about making it unsigned)


https://reviews.llvm.org/D49063





More information about the cfe-commits mailing list