mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Index/SourceKit] Remove the code related to calculating a module hash from the indexing walker
This has been an unnecessary code path for a long time now and should be removed particularly because it triggers wasteful `stat` calls. rdar://51523161
This commit is contained in:
@@ -50,14 +50,9 @@ private:
|
||||
return Logger::isLoggingEnabledForLevel(Logger::Level::Warning);
|
||||
}
|
||||
|
||||
bool recordHash(StringRef hash, bool isKnown) override {
|
||||
return impl.recordHash(hash, isKnown);
|
||||
}
|
||||
|
||||
bool startDependency(StringRef name, StringRef path, bool isClangModule,
|
||||
bool isSystem, StringRef hash) override {
|
||||
bool startDependency(StringRef name, StringRef path, bool isClangModule, bool isSystem) override {
|
||||
auto kindUID = getUIDForDependencyKind(isClangModule);
|
||||
return impl.startDependency(kindUID, name, path, isSystem, hash);
|
||||
return impl.startDependency(kindUID, name, path, isSystem);
|
||||
}
|
||||
|
||||
bool finishDependency(bool isClangModule) override {
|
||||
@@ -168,7 +163,6 @@ private:
|
||||
|
||||
static void indexModule(llvm::MemoryBuffer *Input,
|
||||
StringRef ModuleName,
|
||||
StringRef Hash,
|
||||
IndexingConsumer &IdxConsumer,
|
||||
CompilerInstance &CI,
|
||||
ArrayRef<const char *> Args) {
|
||||
@@ -208,7 +202,7 @@ static void indexModule(llvm::MemoryBuffer *Input,
|
||||
(void)createTypeChecker(Ctx);
|
||||
|
||||
SKIndexDataConsumer IdxDataConsumer(IdxConsumer);
|
||||
index::indexModule(Mod, Hash, IdxDataConsumer);
|
||||
index::indexModule(Mod, IdxDataConsumer);
|
||||
}
|
||||
|
||||
|
||||
@@ -239,8 +233,7 @@ void trace::initTraceInfo(trace::SwiftInvocation &SwiftArgs,
|
||||
|
||||
void SwiftLangSupport::indexSource(StringRef InputFile,
|
||||
IndexingConsumer &IdxConsumer,
|
||||
ArrayRef<const char *> OrigArgs,
|
||||
StringRef Hash) {
|
||||
ArrayRef<const char *> OrigArgs) {
|
||||
std::string Error;
|
||||
auto InputBuf = ASTMgr->getMemoryBuffer(InputFile, Error);
|
||||
if (!InputBuf) {
|
||||
@@ -288,7 +281,7 @@ void SwiftLangSupport::indexSource(StringRef InputFile,
|
||||
}
|
||||
|
||||
indexModule(InputBuf.get(), llvm::sys::path::stem(Filename),
|
||||
Hash, IdxConsumer, CI, Args);
|
||||
IdxConsumer, CI, Args);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -320,5 +313,5 @@ void SwiftLangSupport::indexSource(StringRef InputFile,
|
||||
(void)createTypeChecker(CI.getASTContext());
|
||||
|
||||
SKIndexDataConsumer IdxDataConsumer(IdxConsumer);
|
||||
index::indexSourceFile(CI.getPrimarySourceFile(), Hash, IdxDataConsumer);
|
||||
index::indexSourceFile(CI.getPrimarySourceFile(), IdxDataConsumer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user