Skip to content

Commit 0c6f43a

Browse files
authored
Merge pull request #8482 from nkcsgexi/revert-index
2 parents 3c77cb7 + 936b4a2 commit 0c6f43a

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

include/swift/Index/Index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void indexSourceFile(SourceFile *SF, StringRef hash,
2525
IndexDataConsumer &consumer);
2626
void indexModule(ModuleDecl *module, StringRef hash,
2727
IndexDataConsumer &consumer);
28-
bool shouldIndex(ValueDecl *D, bool IsRef);
28+
2929
} // end namespace index
3030
} // end namespace swift
3131

lib/Index/Index.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,17 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
403403
return SrcMgr.getLineAndColumn(Loc, BufferID);
404404
}
405405

406+
bool shouldIndex(ValueDecl *D, bool IsRef) const {
407+
if (D->isImplicit())
408+
return false;
409+
if (isLocalSymbol(D) && (!isa<ParamDecl>(D) || IsRef))
410+
return false;
411+
if (D->isPrivateStdlibDecl())
412+
return false;
413+
414+
return true;
415+
}
416+
406417
void getModuleHash(SourceFileOrModule SFOrMod, llvm::raw_ostream &OS);
407418
llvm::hash_code hashModule(llvm::hash_code code, SourceFileOrModule SFOrMod);
408419
llvm::hash_code hashFileReference(llvm::hash_code code,
@@ -1249,13 +1260,3 @@ void index::indexModule(ModuleDecl *module, StringRef hash,
12491260
walker.visitModule(*module, hash);
12501261
consumer.finish();
12511262
}
1252-
1253-
bool index::shouldIndex(ValueDecl *D, bool IsRef) {
1254-
if (D->isImplicit())
1255-
return false;
1256-
if (isLocalSymbol(D) && (!isa<ParamDecl>(D) || IsRef))
1257-
return false;
1258-
if (D->isPrivateStdlibDecl())
1259-
return false;
1260-
return true;
1261-
}

0 commit comments

Comments
 (0)