//===----------------------------------------------------------------------===//
#include "CIndexer.h"
+#include "CXCursor.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include <cstdio>
using namespace clang;
+using namespace clang::cxcursor;
using namespace idx;
//===----------------------------------------------------------------------===//
return CXCursor_NotImplemented;
}
-
-static CXCursor MakeCXCursor(CXCursorKind K, Decl *D) {
- CXCursor C = { K, D, 0, 0 };
- return C;
-}
-
-static CXCursor MakeCXCursor(CXCursorKind K, Decl *D, Stmt *S) {
- assert(clang_isReference(K));
- CXCursor C = { K, D, S, 0 };
- return C;
-}
-
static Decl *getDeclFromExpr(Stmt *E) {
if (DeclRefExpr *RefExpr = dyn_cast<DeclRefExpr>(E))
return RefExpr->getDecl();
CIndexCodeCompletion.cpp
CIndexUSRs.cpp
CIndexer.cpp
+ CXCursor.cpp
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
--- /dev/null
+//===- CXCursor.cpp - Routines for manipulating CXCursors -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines routines for manipulating CXCursors.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CXCursor.h"
+#include "clang/AST/Decl.h"
+
+using namespace clang;
+
+CXCursor cxcursor::MakeCXCursor(CXCursorKind K, Decl *D) {
+ CXCursor C = { K, D, 0, 0 };
+ return C;
+}
+
+CXCursor cxcursor::MakeCXCursor(CXCursorKind K, Decl *D, Stmt *S) {
+ assert(clang_isReference(K));
+ CXCursor C = { K, D, S, 0 };
+ return C;
+}
+
--- /dev/null
+//===- CXCursor.h - Routines for manipulating CXCursors -------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines routines for manipulating CXCursors.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CXCURSOR_H
+#define LLVM_CLANG_CXCursor_H
+
+#include "clang-c/Index.h"
+
+namespace clang {
+
+class Decl;
+class Stmt;
+
+namespace cxcursor {
+
+CXCursor MakeCXCursor(CXCursorKind K, clang::Decl *D);
+CXCursor MakeCXCursor(CXCursorKind K, clang::Decl *D, clang::Stmt *S);
+
+}} // end namespace: clang::cxcursor
+
+#endif