Add libclang function 'clang_CXXMethod_isStatic' to query of a C++ method
is declared static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103963 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 753e90e..16cd309 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -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.
//===----------------------------------------------------------------------===//