Skip to content

Commit 9775570

Browse files
committed
[Modules] Fix module hash computation when module file extensions are involved.
Fix an egregious error in with modules and module file extensions, where only the hash code of the module file extension and sysroots would affect the module cache, leading to module file collisions. The effect of this error was likely masked by the old client of module file extensions (Swift) embedding Clang version information.
1 parent 16d41c3 commit 9775570

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,9 @@ std::string CompilerInvocation::getModuleHash() const {
25482548
// Extend the signature with the module file extensions.
25492549
const FrontendOptions &frontendOpts = getFrontendOpts();
25502550
for (const auto &ext : frontendOpts.ModuleFileExtensions) {
2551-
code = ext->hashExtension(code);
2551+
code = hash_combine(code, ext->hashExtension(code));
2552+
}
2553+
25522554
}
25532555

25542556
// Darwin-specific hack: if we have a sysroot, use the contents and

0 commit comments

Comments
 (0)