[Serialization] Use the module interface as the name of the file

...rather than the buffer, for a compiled module that came from a
module interface.

This was already happening at a higher level
(ModuleDecl::getModuleFilename) so pushing it down to the low-level
ModuleFile::getModuleFilename doesn't really change things much. The
important fix that goes with this is that SerializedASTFile no longer
leaks this name by storing it outside of ModuleFile.

https://bugs.swift.org/browse/SR-11365
This commit is contained in:
Jordan Rose
2019-08-23 16:53:30 -07:00
parent d8c823e159
commit e479e1398d
7 changed files with 8 additions and 25 deletions

View File

@@ -1249,10 +1249,6 @@ StringRef ModuleDecl::getModuleFilename() const {
// per-file names. Modules can consist of more than one file.
StringRef Result;
for (auto F : getFiles()) {
Result = F->getParseableInterface();
if (!Result.empty())
return Result;
if (auto SF = dyn_cast<SourceFile>(F)) {
if (!Result.empty())
return StringRef();