diff options
Diffstat (limited to 'contrib/llvm/tools/clang/include/clang-c')
-rw-r--r-- | contrib/llvm/tools/clang/include/clang-c/Index.h | 170 |
1 files changed, 143 insertions, 27 deletions
diff --git a/contrib/llvm/tools/clang/include/clang-c/Index.h b/contrib/llvm/tools/clang/include/clang-c/Index.h index edd3cbb..aa3403c 100644 --- a/contrib/llvm/tools/clang/include/clang-c/Index.h +++ b/contrib/llvm/tools/clang/include/clang-c/Index.h @@ -23,6 +23,34 @@ #include "clang-c/Platform.h" #include "clang-c/CXString.h" +/** + * \brief The version constants for the libclang API. + * CINDEX_VERSION_MINOR should increase when there are API additions. + * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes. + * + * The policy about the libclang API was always to keep it source and ABI + * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. + */ +#define CINDEX_VERSION_MAJOR 0 +#define CINDEX_VERSION_MINOR 6 + +#define CINDEX_VERSION_ENCODE(major, minor) ( \ + ((major) * 10000) \ + + ((minor) * 1)) + +#define CINDEX_VERSION CINDEX_VERSION_ENCODE( \ + CINDEX_VERSION_MAJOR, \ + CINDEX_VERSION_MINOR ) + +#define CINDEX_VERSION_STRINGIZE_(major, minor) \ + #major"."#minor +#define CINDEX_VERSION_STRINGIZE(major, minor) \ + CINDEX_VERSION_STRINGIZE_(major, minor) + +#define CINDEX_VERSION_STRING CINDEX_VERSION_STRINGIZE( \ + CINDEX_VERSION_MAJOR, \ + CINDEX_VERSION_MINOR) + #ifdef __cplusplus extern "C" { #endif @@ -383,7 +411,7 @@ CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, CXSourceRange range2); /** - * \brief Returns non-zero if \arg range is null. + * \brief Returns non-zero if \p range is null. */ CINDEX_LINKAGE int clang_Range_isNull(CXSourceRange range); @@ -1035,13 +1063,15 @@ enum CXTranslationUnit_Flags { * code-completion operations. */ CXTranslationUnit_CacheCompletionResults = 0x08, + /** - * \brief DEPRECATED: Enable precompiled preambles in C++. + * \brief Used to indicate that the translation unit will be serialized with + * \c clang_saveTranslationUnit. * - * Note: this is a *temporary* option that is available only while - * we are testing C++ precompiled preamble support. It is deprecated. + * This option is typically used when parsing a header with the intent of + * producing a precompiled header. */ - CXTranslationUnit_CXXPrecompiledPreamble = 0x10, + CXTranslationUnit_ForSerialization = 0x10, /** * \brief DEPRECATED: Enabled chained precompiled preambles in C++. @@ -1904,9 +1934,10 @@ enum CXCursorKind { */ CXCursor_ReturnStmt = 214, - /** \brief A GNU inline assembly statement extension. + /** \brief A GCC inline assembly statement extension. */ - CXCursor_AsmStmt = 215, + CXCursor_GCCAsmStmt = 215, + CXCursor_AsmStmt = CXCursor_GCCAsmStmt, /** \brief Objective-C's overall \@try-\@catch-\@finally statement. */ @@ -2009,7 +2040,15 @@ enum CXCursorKind { CXCursor_MacroInstantiation = CXCursor_MacroExpansion, CXCursor_InclusionDirective = 503, CXCursor_FirstPreprocessing = CXCursor_PreprocessingDirective, - CXCursor_LastPreprocessing = CXCursor_InclusionDirective + CXCursor_LastPreprocessing = CXCursor_InclusionDirective, + + /* Extra Declarations */ + /** + * \brief A module import declaration. + */ + CXCursor_ModuleImportDecl = 600, + CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl, + CXCursor_LastExtraDecl = CXCursor_ModuleImportDecl }; /** @@ -2040,7 +2079,8 @@ typedef struct { * \brief A comment AST node. */ typedef struct { - const void *Data; + const void *ASTNode; + CXTranslationUnit TranslationUnit; } CXComment; /** @@ -2068,9 +2108,9 @@ CINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit); CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor); /** - * \brief Returns non-zero if \arg cursor is null. + * \brief Returns non-zero if \p cursor is null. */ -CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor); +CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor); /** * \brief Compute a hash value for the given cursor. @@ -2585,6 +2625,7 @@ enum CXCallingConv { CXCallingConv_X86Pascal = 5, CXCallingConv_AAPCS = 6, CXCallingConv_AAPCS_VFP = 7, + CXCallingConv_PnaclCall = 8, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 @@ -3164,6 +3205,12 @@ CINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor); CINDEX_LINKAGE int clang_Cursor_isDynamicCall(CXCursor C); /** + * \brief Given a cursor pointing to an ObjC message, returns the CXType of the + * receiver. + */ +CINDEX_LINKAGE CXType clang_Cursor_getReceiverType(CXCursor C); + +/** * \brief Given a cursor that represents a declaration, return the associated * comment's source range. The range may include multiple consecutive comments * with whitespace in between. @@ -3195,6 +3242,65 @@ 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 a 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 Module); + +/** + * \param Module a 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 Module); + +/** + * \param Module a module object. + * + * \returns the full name of the module, e.g. "std.vector". + */ +CINDEX_LINKAGE CXString clang_Module_getFullName(CXModule Module); + +/** + * \param Module a module object. + * + * \returns the number of top level headers associated with this module. + */ +CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXModule Module); + +/** + * \param Module a 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 Module, unsigned Index); + +/** + * @} + */ + +/** * \defgroup CINDEX_COMMENT Comment AST introspection * * The routines in this group provide access to information in the @@ -3272,7 +3378,7 @@ enum CXCommentKind { * \brief A \\param or \\arg command that describes the function parameter * (name, passing direction, description). * - * \brief For example: \\param [in] ParamName description. + * For example: \\param [in] ParamName description. */ CXComment_ParamCommand = 7, @@ -3280,7 +3386,7 @@ enum CXCommentKind { * \brief A \\tparam command that describes a template parameter (name and * description). * - * \brief For example: \\tparam T description. + * For example: \\tparam T description. */ CXComment_TParamCommand = 8, @@ -3379,7 +3485,7 @@ CINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment); /** * \param Comment AST node of any kind. * - * \param ArgIdx argument index (zero-based). + * \param ChildIdx child index (zero-based). * * \returns the specified child of the AST node. */ @@ -3692,14 +3798,11 @@ CINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment); * A Relax NG schema for the XML can be found in comment-xml-schema.rng file * inside clang source tree. * - * \param TU the translation unit \c Comment belongs to. - * * \param Comment a \c CXComment_FullComment AST node. * * \returns string containing an XML document. */ -CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXTranslationUnit TU, - CXComment Comment); +CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); /** * @} @@ -4323,8 +4426,7 @@ clang_getCompletionAnnotation(CXCompletionString completion_string, * \param completion_string The code completion string whose parent is * being queried. * - * \param kind If non-NULL, will be set to the kind of the parent context, - * or CXCursor_NotImplemented if there is no context. + * \param kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL. * * \returns The name of the completion parent, e.g., "NSObject" if * the completion string represents a method in the NSObject class. @@ -4917,22 +5019,35 @@ typedef struct { CXFile file; int isImport; int isAngled; + /** + * \brief Non-zero if the directive was automatically turned into a module + * import. + */ + int isModuleImport; } CXIdxIncludedFileInfo; /** * \brief Data for IndexerCallbacks#importedASTFile. */ typedef struct { + /** + * \brief Top level AST file containing the imported PCH, module or submodule. + */ CXFile file; /** - * \brief Location where the file is imported. It is useful mostly for - * modules. + * \brief The imported module or NULL if the AST file is a PCH. + */ + CXModule module; + /** + * \brief Location where the file is imported. Applicable only for modules. */ CXIdxLoc loc; /** - * \brief Non-zero if the AST file is a module otherwise it's a PCH. + * \brief Non-zero if an inclusion directive was automatically turned into + * a module import. Applicable only for modules. */ - int isModule; + int isImplicit; + } CXIdxImportedASTFileInfo; typedef enum { @@ -4965,7 +5080,8 @@ typedef enum { CXIdxEntity_CXXConstructor = 22, CXIdxEntity_CXXDestructor = 23, CXIdxEntity_CXXConversionFunction = 24, - CXIdxEntity_CXXTypeAlias = 25 + CXIdxEntity_CXXTypeAlias = 25, + CXIdxEntity_CXXInterface = 26 } CXIdxEntityKind; @@ -5183,8 +5299,8 @@ typedef struct { * * AST files will not get indexed (there will not be callbacks to index all * the entities in an AST file). The recommended action is that, if the AST - * file is not already indexed, to block further indexing and initiate a new - * indexing job specific to the AST file. + * file is not already indexed, to initiate a new indexing job specific to + * the AST file. */ CXIdxClientASTFile (*importedASTFile)(CXClientData client_data, const CXIdxImportedASTFileInfo *); |