Skip to content

Commit 42d7b94

Browse files
author
git apple-llvm automerger
committed
Merge commit '572b89a1f42b' from llvm.org/main into next
2 parents 2b67e06 + ee7c43b commit 42d7b94

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ class ModuleDepCollector final : public DependencyCollector {
331331
const ArrayRef<StringRef> StableDirs;
332332
/// Path to the main source file.
333333
std::string MainFile;
334-
/// Hash identifying the compilation conditions of the current TU.
335-
std::string ContextHash;
336334
/// Non-modular file dependencies. This includes the main source file and
337335
/// textually included header files.
338336
std::vector<std::string> FileDeps;

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,6 @@ void ModuleDepCollectorPP::LexedFileChanged(FileID FID,
701701
if (Reason != LexedFileChangeReason::EnterFile)
702702
return;
703703

704-
// This has to be delayed as the context hash can change at the start of
705-
// `CompilerInstance::ExecuteAction`.
706-
if (MDC.ContextHash.empty()) {
707-
MDC.ContextHash = MDC.ScanInstance.getInvocation().getModuleHash(
708-
MDC.ScanInstance.getDiagnostics());
709-
MDC.Consumer.handleContextHash(MDC.ContextHash);
710-
}
711-
712704
SourceManager &SM = MDC.ScanInstance.getSourceManager();
713705

714706
// Dependency generation really does want to go all the way to the
@@ -790,6 +782,9 @@ void ModuleDepCollectorPP::EndOfMainFile() {
790782
for (const Module *M : MDC.DirectModularDeps)
791783
handleTopLevelModule(M);
792784

785+
MDC.Consumer.handleContextHash(MDC.ScanInstance.getInvocation().getModuleHash(
786+
MDC.ScanInstance.getDiagnostics()));
787+
793788
MDC.Consumer.handleDependencyOutputOpts(*MDC.Opts);
794789

795790
if (MDC.Service.getFormat() == ScanningOutputFormat::P1689)

0 commit comments

Comments
 (0)