diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-05 00:22:37 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-05 00:22:37 +0000 |
| commit | 2b9b5bb697d40fe6a348464a6da66e74c81fdbd4 (patch) | |
| tree | e80f63e8879504ce78e3a6a1fc032c0bbc27080e /clang/include/clang-c | |
| parent | c597c8c48b977d70996bc55e36e230f264120516 (diff) | |
| download | bcm5719-llvm-2b9b5bb697d40fe6a348464a6da66e74c81fdbd4.tar.gz bcm5719-llvm-2b9b5bb697d40fe6a348464a6da66e74c81fdbd4.zip | |
[libclang] Introduce new C functions that provide information about modules:
clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader
llvm-svn: 165280
Diffstat (limited to 'clang/include/clang-c')
| -rw-r--r-- | clang/include/clang-c/Index.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index c2b1f25f831..f7a319b5f2b 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -3205,6 +3205,64 @@ CINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C); */ /** + * \defgroup CINDEX_MODULE Module introspection + * + * The functions in this group provide access to information about modules. + * + * @{ + */ + +typedef void *CXModule; + +/** + * \brief Given a CXCursor_ModuleImportDecl cursor, return the associated module. + */ +CINDEX_LINKAGE CXModule clang_Cursor_getModule(CXCursor C); + +/** + * \param Module object. + * + * \returns the parent of a sub-module or NULL if the given module is top-level, + * e.g. for 'std.vector' it will return the 'std' module. + */ +CINDEX_LINKAGE CXModule clang_Module_getParent(CXModule); + +/** + * \param Module object. + * + * \returns the name of the module, e.g. for the 'std.vector' sub-module it + * will return "vector". + */ +CINDEX_LINKAGE CXString clang_Module_getName(CXModule); + +/** + * \param Module object. + * + * \returns the full name of the module, e.g. "std.vector". + */ +CINDEX_LINKAGE CXString clang_Module_getFullName(CXModule); + +/** + * \param Module object. + * + * \returns the number of top level headers associated with this module. + */ +CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXModule); + +/** + * \param Module object. + * + * \param Index top level header index (zero-based). + * + * \returns the specified top level header associated with the module. + */ +CINDEX_LINKAGE CXFile clang_Module_getTopLevelHeader(CXModule, unsigned Index); + +/** + * @} + */ + +/** * \defgroup CINDEX_COMMENT Comment AST introspection * * The routines in this group provide access to information in the |

