[cfe-commits] r103963 - in /cfe/trunk: include/clang-c/Index.h tools/libclang/CIndex.cpp tools/libclang/libclang.darwin.exports tools/libclang/libclang.exports
Ted Kremenek
kremenek at apple.com
Mon May 17 13:06:56 PDT 2010
Author: kremenek
Date: Mon May 17 15:06:56 2010
New Revision: 103963
URL: http://llvm.org/viewvc/llvm-project?rev=103963&view=rev
Log:
Add libclang function 'clang_CXXMethod_isStatic' to query of a C++ method
is declared static.
Modified:
cfe/trunk/include/clang-c/Index.h
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/libclang.darwin.exports
cfe/trunk/tools/libclang/libclang.exports
Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=103963&r1=103962&r2=103963&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Mon May 17 15:06:56 2010
@@ -1341,6 +1341,24 @@
*/
/**
+ * \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);
+
+/**
+ * @}
+ */
+
+/**
* \defgroup CINDEX_LEX Token extraction and manipulation
*
* The routines in this group provide access to the tokens within a
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=103963&r1=103962&r2=103963&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Mon May 17 15:06:56 2010
@@ -2752,6 +2752,19 @@
}
} // 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.
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/tools/libclang/libclang.darwin.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/libclang.darwin.exports?rev=103963&r1=103962&r2=103963&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/libclang.darwin.exports (original)
+++ cfe/trunk/tools/libclang/libclang.darwin.exports Mon May 17 15:06:56 2010
@@ -1,3 +1,4 @@
+_clang_CXXMethod_isStatic
_clang_annotateTokens
_clang_codeComplete
_clang_codeCompleteGetDiagnostic
@@ -23,8 +24,8 @@
_clang_equalLocations
_clang_equalTypes
_clang_formatDiagnostic
-_clang_getCanonicalType
_clang_getCString
+_clang_getCanonicalType
_clang_getClangVersion
_clang_getCompletionChunkCompletionString
_clang_getCompletionChunkKind
Modified: cfe/trunk/tools/libclang/libclang.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/libclang.exports?rev=103963&r1=103962&r2=103963&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/libclang.exports (original)
+++ cfe/trunk/tools/libclang/libclang.exports Mon May 17 15:06:56 2010
@@ -1,3 +1,4 @@
+clang_CXXMethod_isStatic
clang_annotateTokens
clang_codeComplete
clang_codeCompleteGetDiagnostic
@@ -23,8 +24,8 @@
clang_equalLocations
clang_equalTypes
clang_formatDiagnostic
-clang_getCanonicalType
clang_getCString
+clang_getCanonicalType
clang_getClangVersion
clang_getCompletionChunkCompletionString
clang_getCompletionChunkKind
More information about the cfe-commits
mailing list