summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-04-11 19:32:19 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-04-11 19:32:19 +0000
commit0c27e4b36bd031fda61a8a457e33221fc2177370 (patch)
tree7dda5feb7e95bf27c3b9ad9485ea1ae905e444ea /clang/include/clang-c
parentcc899f3b6dc88107e612bc33b1489e5594850ddf (diff)
downloadbcm5719-llvm-0c27e4b36bd031fda61a8a457e33221fc2177370.tar.gz
bcm5719-llvm-0c27e4b36bd031fda61a8a457e33221fc2177370.zip
[libclang] Introduce a couple of functions to make it convenient
to get at the parameters (and their types) of a function or objc method cursor. int clang_Cursor_getNumArguments(CXCursor C); CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i); rdar://11201527 llvm-svn: 154523
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 4568a764e0e..18316b4d33c 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -2525,6 +2525,22 @@ CINDEX_LINKAGE long long clang_getEnumConstantDeclValue(CXCursor C);
CINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C);
/**
+ * \brief Retrieve the number of non-variadic arguments associated with a given
+ * cursor.
+ *
+ * If a cursor that is not a function or method is passed in, -1 is returned.
+ */
+CINDEX_LINKAGE int clang_Cursor_getNumArguments(CXCursor C);
+
+/**
+ * \brief Retrieve the argument cursor of a function or method.
+ *
+ * If a cursor that is not a function or method is passed in or the index
+ * exceeds the number of arguments, an invalid cursor is returned.
+ */
+CINDEX_LINKAGE CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i);
+
+/**
* \determine Determine whether two CXTypes represent the same type.
*
* \returns non-zero if the CXTypes represent the same type and
@@ -2598,9 +2614,9 @@ CINDEX_LINKAGE CXType clang_getResultType(CXType T);
/**
* \brief Retrieve the number of non-variadic arguments associated with a function type.
*
- * If a non-function type is passed in, UINT_MAX is returned.
+ * If a non-function type is passed in, -1 is returned.
*/
-CINDEX_LINKAGE unsigned clang_getNumArgTypes(CXType T);
+CINDEX_LINKAGE int clang_getNumArgTypes(CXType T);
/**
* \brief Retrieve the type of an argument of a function type.
OpenPOWER on IntegriCloud