[cfe-commits] r101070 - in /cfe/trunk: include/clang-c/Index.h tools/CIndex/CIndex.cpp tools/CIndex/CIndex.exports

Douglas Gregor dgregor at apple.com
Mon Apr 12 14:33:59 PDT 2010


On Apr 12, 2010, at 2:22 PM, Ted Kremenek wrote:

> Author: kremenek
> Date: Mon Apr 12 16:22:16 2010
> New Revision: 101070
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=101070&view=rev
> Log:
> Add 'clang_getCursorLanguage' to return the "language" of the AST element (e.g., distinguish between C and Objective-C language features).  Currently this only returns results for declarations.
> 
> Modified:
>    cfe/trunk/include/clang-c/Index.h
>    cfe/trunk/tools/CIndex/CIndex.cpp
>    cfe/trunk/tools/CIndex/CIndex.exports
> 
> Modified: cfe/trunk/include/clang-c/Index.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=101070&r1=101069&r2=101070&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang-c/Index.h (original)
> +++ cfe/trunk/include/clang-c/Index.h Mon Apr 12 16:22:16 2010
> @@ -936,11 +936,26 @@
> };
> 
> /**
> - * \brief Determine the linkage of the entity referred to be a given cursor.
> + * \brief Determine the linkage of the entity referred to by a given cursor.
>  */
> CINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor);
> 
> /**
> + * \brief Describe the "language" of the entity referred to by a cursor.
> + */
> +CINDEX_LINKAGE enum CXLanguageKind {
> +  CXLanguage_C,
> +  CXLanguage_ObjC,
> +  CXLanguage_CPlusPlus,
> +  CXLanguage_Invalid
> +};

Would it be slightly more convenient to have CXLanguage_Invalid be the enumerator with integral value 0?

	- Doug



More information about the cfe-commits mailing list