Add libclang function 'clang_CXXMethod_isStatic' to query of a C++ method

is declared static.

llvm-svn: 103963
This commit is contained in:
Ted Kremenek 2010-05-17 20:06:56 +00:00
parent 84a8415ed7
commit 9cfe9e6a4a
4 changed files with 35 additions and 2 deletions

View File

@ -1336,6 +1336,24 @@ CINDEX_LINKAGE CXCursor clang_getCursorDefinition(CXCursor);
*/
CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor);
/**
* @}
*/
/**
* \defgroup CINDEX_CPP C++ AST introspection
*
* The routines in this group provide access information in the ASTs specific
* to C++ language features.
*
* @{
*/
/**
* \brief Determine if a C++ member function is declared 'static'.
*/
CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C);
/**
* @}
*/

View File

@ -2752,6 +2752,19 @@ CXLanguageKind clang_getCursorLanguage(CXCursor cursor) {
}
} // end: extern "C"
//===----------------------------------------------------------------------===//
// C++ AST instrospection.
//===----------------------------------------------------------------------===//
extern "C" {
unsigned clang_CXXMethod_isStatic(CXCursor C) {
if (!clang_isDeclaration(C.kind))
return 0;
CXXMethodDecl *D = dyn_cast<CXXMethodDecl>(cxcursor::getCursorDecl(C));
return (D && D->isStatic()) ? 1 : 0;
} // end: extern "C"
//===----------------------------------------------------------------------===//
// CXString Operations.
//===----------------------------------------------------------------------===//

View File

@ -1,3 +1,4 @@
_clang_CXXMethod_isStatic
_clang_annotateTokens
_clang_codeComplete
_clang_codeCompleteGetDiagnostic
@ -23,8 +24,8 @@ _clang_equalCursors
_clang_equalLocations
_clang_equalTypes
_clang_formatDiagnostic
_clang_getCanonicalType
_clang_getCString
_clang_getCanonicalType
_clang_getClangVersion
_clang_getCompletionChunkCompletionString
_clang_getCompletionChunkKind

View File

@ -1,3 +1,4 @@
clang_CXXMethod_isStatic
clang_annotateTokens
clang_codeComplete
clang_codeCompleteGetDiagnostic
@ -23,8 +24,8 @@ clang_equalCursors
clang_equalLocations
clang_equalTypes
clang_formatDiagnostic
clang_getCanonicalType
clang_getCString
clang_getCanonicalType
clang_getClangVersion
clang_getCompletionChunkCompletionString
clang_getCompletionChunkKind