[indexer] Index references to system headers

This commit is contained in:
Fangrui Song 2017-12-17 19:47:14 -08:00 committed by Jacob Dufault
parent ef7215cd7f
commit 9fd35db034

View File

@ -1357,13 +1357,6 @@ bool IsFunctionCallContext(CXCursorKind kind) {
} }
void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) { void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) {
// Don't index references from or to system headers.
if (clang_Location_isInSystemHeader(
clang_indexLoc_getCXSourceLocation(ref->loc)) ||
clang_Location_isInSystemHeader(
clang_getCursorLocation(ref->referencedEntity->cursor)))
return;
// TODO: Use clang_getFileUniqueID // TODO: Use clang_getFileUniqueID
CXFile file; CXFile file;
clang_getSpellingLocation(clang_indexLoc_getCXSourceLocation(ref->loc), &file, clang_getSpellingLocation(clang_indexLoc_getCXSourceLocation(ref->loc), &file,