#include "CursorVisitor.h"
#include "CLog.h"
#include "CXCursor.h"
#include "CXFile.h"
#include "CXSourceLocation.h"
#include "CXTranslationUnit.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Frontend/ASTUnit.h"
#include "llvm/Support/Compiler.h"
usingnamespaceclang;
usingnamespacecxcursor;
usingnamespacecxindex;
static void getTopOverriddenMethods(CXTranslationUnit TU,
const Decl *D,
SmallVectorImpl<const Decl *> &Methods) { … }
namespace {
struct FindFileIdRefVisitData { … };
}
static SourceLocation getFileSpellingLoc(SourceManager &SM,
SourceLocation Loc,
bool &isMacroArg) { … }
static enum CXChildVisitResult findFileIdRefVisit(CXCursor cursor,
CXCursor parent,
CXClientData client_data) { … }
static bool findIdRefsInFile(CXTranslationUnit TU, CXCursor declCursor,
const FileEntry *File,
CXCursorAndRangeVisitor Visitor) { … }
namespace {
struct FindFileMacroRefVisitData { … };
}
static enum CXChildVisitResult findFileMacroRefVisit(CXCursor cursor,
CXCursor parent,
CXClientData client_data) { … }
static bool findMacroRefsInFile(CXTranslationUnit TU, CXCursor Cursor,
const FileEntry *File,
CXCursorAndRangeVisitor Visitor) { … }
namespace {
struct FindFileIncludesVisitor { … };
}
static bool findIncludesInFile(CXTranslationUnit TU, const FileEntry *File,
CXCursorAndRangeVisitor Visitor) { … }
extern "C" {
CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file,
CXCursorAndRangeVisitor visitor) { … }
CXResult clang_findIncludesInFile(CXTranslationUnit TU, CXFile file,
CXCursorAndRangeVisitor visitor) { … }
static enum CXVisitorResult _visitCursorAndRange(void *context,
CXCursor cursor,
CXSourceRange range) { … }
CXResult clang_findReferencesInFileWithBlock(CXCursor cursor,
CXFile file,
CXCursorAndRangeVisitorBlock block) { … }
CXResult clang_findIncludesInFileWithBlock(CXTranslationUnit TU,
CXFile file,
CXCursorAndRangeVisitorBlock block) { … }
}