forked from OSchip/llvm-project
Add libclang function 'clang_CXXMethod_isStatic' to query of a C++ method
is declared static. llvm-svn: 103963
This commit is contained in:
parent
84a8415ed7
commit
9cfe9e6a4a
|
@ -1336,6 +1336,24 @@ CINDEX_LINKAGE CXCursor clang_getCursorDefinition(CXCursor);
|
||||||
*/
|
*/
|
||||||
CINDEX_LINKAGE unsigned clang_isCursorDefinition(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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2752,6 +2752,19 @@ CXLanguageKind clang_getCursorLanguage(CXCursor cursor) {
|
||||||
}
|
}
|
||||||
} // end: extern "C"
|
} // 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.
|
// CXString Operations.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
_clang_CXXMethod_isStatic
|
||||||
_clang_annotateTokens
|
_clang_annotateTokens
|
||||||
_clang_codeComplete
|
_clang_codeComplete
|
||||||
_clang_codeCompleteGetDiagnostic
|
_clang_codeCompleteGetDiagnostic
|
||||||
|
@ -23,8 +24,8 @@ _clang_equalCursors
|
||||||
_clang_equalLocations
|
_clang_equalLocations
|
||||||
_clang_equalTypes
|
_clang_equalTypes
|
||||||
_clang_formatDiagnostic
|
_clang_formatDiagnostic
|
||||||
_clang_getCanonicalType
|
|
||||||
_clang_getCString
|
_clang_getCString
|
||||||
|
_clang_getCanonicalType
|
||||||
_clang_getClangVersion
|
_clang_getClangVersion
|
||||||
_clang_getCompletionChunkCompletionString
|
_clang_getCompletionChunkCompletionString
|
||||||
_clang_getCompletionChunkKind
|
_clang_getCompletionChunkKind
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
clang_CXXMethod_isStatic
|
||||||
clang_annotateTokens
|
clang_annotateTokens
|
||||||
clang_codeComplete
|
clang_codeComplete
|
||||||
clang_codeCompleteGetDiagnostic
|
clang_codeCompleteGetDiagnostic
|
||||||
|
@ -23,8 +24,8 @@ clang_equalCursors
|
||||||
clang_equalLocations
|
clang_equalLocations
|
||||||
clang_equalTypes
|
clang_equalTypes
|
||||||
clang_formatDiagnostic
|
clang_formatDiagnostic
|
||||||
clang_getCanonicalType
|
|
||||||
clang_getCString
|
clang_getCString
|
||||||
|
clang_getCanonicalType
|
||||||
clang_getClangVersion
|
clang_getClangVersion
|
||||||
clang_getCompletionChunkCompletionString
|
clang_getCompletionChunkCompletionString
|
||||||
clang_getCompletionChunkKind
|
clang_getCompletionChunkKind
|
||||||
|
|
Loading…
Reference in New Issue