Skip to content

Commit b6150b0

Browse files
committed
[Serialization] Remove duplicated IsSIB bit
Store the bit on the ModuleFile, and query it from the SerializedASTFile.
1 parent 89a3d66 commit b6150b0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

include/swift/Serialization/SerializedModuleLoader.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,15 @@ class SerializedASTFile final : public LoadedFile {
306306

307307
ModuleFile &File;
308308

309-
bool IsSIB;
310-
311-
SerializedASTFile(ModuleDecl &M, ModuleFile &file, bool isSIB = false)
312-
: LoadedFile(FileUnitKind::SerializedAST, M), File(file), IsSIB(isSIB) {}
309+
SerializedASTFile(ModuleDecl &M, ModuleFile &file)
310+
: LoadedFile(FileUnitKind::SerializedAST, M), File(file) {}
313311

314312
void
315313
collectLinkLibrariesFromImports(ModuleDecl::LinkLibraryCallback callback) const;
316314

317315
public:
318-
bool isSIB() const { return IsSIB; }
316+
/// Whether this represents a '.sib' file.
317+
bool isSIB() const;
319318

320319
/// Returns the language version that was used to compile the contents of this
321320
/// file.

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,7 @@ FileUnit *SerializedModuleLoaderBase::loadAST(
677677
M.setResilienceStrategy(extendedInfo.getResilienceStrategy());
678678

679679
// We've loaded the file. Now try to bring it into the AST.
680-
auto fileUnit = new (Ctx) SerializedASTFile(M, *loadedModuleFile,
681-
extendedInfo.isSIB());
680+
auto fileUnit = new (Ctx) SerializedASTFile(M, *loadedModuleFile);
682681
M.addFile(*fileUnit);
683682
if (extendedInfo.isTestable())
684683
M.setTestingEnabled();
@@ -1100,6 +1099,10 @@ void SerializedASTFile::collectLinkLibraries(
11001099
}
11011100
}
11021101

1102+
bool SerializedASTFile::isSIB() const {
1103+
return File.IsSIB;
1104+
}
1105+
11031106
bool SerializedASTFile::isSystemModule() const {
11041107
if (auto Mod = File.getUnderlyingModule()) {
11051108
return Mod->isSystemModule();

0 commit comments

Comments
 (0)