@@ -960,7 +960,7 @@ void Serializer::writeBlockInfoBlock() {
960
960
#undef BLOCK_RECORD
961
961
}
962
962
963
- void Serializer::writeHeader (const SerializationOptions &options ) {
963
+ void Serializer::writeHeader () {
964
964
{
965
965
BCBlockRAII restoreBlock (Out, CONTROL_BLOCK_ID, 4 );
966
966
control_block::ModuleNameLayout ModuleName (Out);
@@ -984,17 +984,17 @@ void Serializer::writeHeader(const SerializationOptions &options) {
984
984
size_t compatibilityVersionStringLength =
985
985
versionString.tell () - shortVersionStringLength - 1 ;
986
986
versionString << " )/" << version::getSwiftFullVersion ();
987
- auto userModuleMajor = options .UserModuleVersion .getMajor ();
987
+ auto userModuleMajor = Options .UserModuleVersion .getMajor ();
988
988
auto userModuleMinor = 0 ;
989
- if (auto minor = options .UserModuleVersion .getMinor ()) {
989
+ if (auto minor = Options .UserModuleVersion .getMinor ()) {
990
990
userModuleMinor = *minor;
991
991
}
992
992
auto userModuleSubminor = 0 ;
993
- if (auto subMinor = options .UserModuleVersion .getSubminor ()) {
993
+ if (auto subMinor = Options .UserModuleVersion .getSubminor ()) {
994
994
userModuleSubminor = *subMinor;
995
995
}
996
996
auto userModuleBuild = 0 ;
997
- if (auto build = options .UserModuleVersion .getBuild ()) {
997
+ if (auto build = Options .UserModuleVersion .getBuild ()) {
998
998
userModuleBuild = *build;
999
999
}
1000
1000
Metadata.emit (ScratchRecord,
@@ -1005,10 +1005,10 @@ void Serializer::writeHeader(const SerializationOptions &options) {
1005
1005
userModuleSubminor, userModuleBuild,
1006
1006
versionString.str ());
1007
1007
1008
- if (!options .SDKName .empty ())
1009
- SDKName.emit (ScratchRecord, options .SDKName );
1008
+ if (!Options .SDKName .empty ())
1009
+ SDKName.emit (ScratchRecord, Options .SDKName );
1010
1010
1011
- for (auto &name: options .AllowableClients ) {
1011
+ for (auto &name : Options .AllowableClients ) {
1012
1012
Allowable.emit (ScratchRecord, name);
1013
1013
}
1014
1014
Target.emit (ScratchRecord, M->getASTContext ().LangOpts .Target .str ());
@@ -1020,20 +1020,20 @@ void Serializer::writeHeader(const SerializationOptions &options) {
1020
1020
forcedDebugRevision : version::getCurrentCompilerSerializationTag ();
1021
1021
Revision.emit (ScratchRecord, revision);
1022
1022
1023
- IsOSSA.emit (ScratchRecord, options .IsOSSA );
1023
+ IsOSSA.emit (ScratchRecord, Options .IsOSSA );
1024
1024
1025
1025
{
1026
1026
llvm::BCBlockRAII restoreBlock (Out, OPTIONS_BLOCK_ID, 4 );
1027
1027
1028
1028
options_block::IsSIBLayout IsSIB (Out);
1029
- IsSIB.emit (ScratchRecord, options .IsSIB );
1029
+ IsSIB.emit (ScratchRecord, Options .IsSIB );
1030
1030
1031
- if (options .StaticLibrary ) {
1031
+ if (Options .StaticLibrary ) {
1032
1032
options_block::IsStaticLibraryLayout IsStaticLibrary (Out);
1033
1033
IsStaticLibrary.emit (ScratchRecord);
1034
1034
}
1035
1035
1036
- if (options .HermeticSealAtLink ) {
1036
+ if (Options .HermeticSealAtLink ) {
1037
1037
options_block::HasHermeticSealAtLinkLayout HasHermeticSealAtLink (Out);
1038
1038
HasHermeticSealAtLink.emit (ScratchRecord);
1039
1039
}
@@ -1095,17 +1095,17 @@ void Serializer::writeHeader(const SerializationOptions &options) {
1095
1095
CxxInteroperabilityEnabled.emit (ScratchRecord);
1096
1096
}
1097
1097
1098
- if (options .SerializeOptionsForDebugging ) {
1098
+ if (Options .SerializeOptionsForDebugging ) {
1099
1099
options_block::SDKPathLayout SDKPath (Out);
1100
1100
options_block::XCCLayout XCC (Out);
1101
1101
1102
- const auto &PathRemapper = options .DebuggingOptionsPrefixMap ;
1103
- const auto &PathObfuscator = options .PathObfuscator ;
1102
+ const auto &PathRemapper = Options .DebuggingOptionsPrefixMap ;
1103
+ const auto &PathObfuscator = Options .PathObfuscator ;
1104
1104
auto sdkPath = M->getASTContext ().SearchPathOpts .getSDKPath ();
1105
1105
SDKPath.emit (
1106
1106
ScratchRecord,
1107
1107
PathObfuscator.obfuscate (PathRemapper.remapPath (sdkPath)));
1108
- auto &Opts = options .ExtraClangOptions ;
1108
+ auto &Opts = Options .ExtraClangOptions ;
1109
1109
for (auto Arg = Opts.begin (), E = Opts.end (); Arg != E; ++Arg) {
1110
1110
StringRef arg (*Arg);
1111
1111
if (arg.startswith (" -ivfsoverlay" )) {
@@ -1137,7 +1137,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
1137
1137
1138
1138
// Macro plugins
1139
1139
options_block::PluginSearchOptionLayout PluginSearchOpt (Out);
1140
- for (auto &elem : options .PluginSearchOptions ) {
1140
+ for (auto &elem : Options .PluginSearchOptions ) {
1141
1141
switch (elem.getKind ()) {
1142
1142
case PluginSearchOption::Kind::PluginPath: {
1143
1143
auto &opt = elem.get <PluginSearchOption::PluginPath>();
@@ -1213,7 +1213,7 @@ static ImportSet getImportsAsSet(const ModuleDecl *M,
1213
1213
return importSet;
1214
1214
}
1215
1215
1216
- void Serializer::writeInputBlock (const SerializationOptions &options ) {
1216
+ void Serializer::writeInputBlock () {
1217
1217
BCBlockRAII restoreBlock (Out, INPUT_BLOCK_ID, 4 );
1218
1218
input_block::ImportedModuleLayout importedModule (Out);
1219
1219
input_block::ImportedModuleLayoutSPI ImportedModuleSPI (Out);
@@ -1225,9 +1225,9 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
1225
1225
input_block::DependencyDirectoryLayout DependencyDirectory (Out);
1226
1226
input_block::ModuleInterfaceLayout ModuleInterface (Out);
1227
1227
1228
- if (options .SerializeOptionsForDebugging ) {
1229
- const auto &PathObfuscator = options .PathObfuscator ;
1230
- const auto &PathMapper = options .DebuggingOptionsPrefixMap ;
1228
+ if (Options .SerializeOptionsForDebugging ) {
1229
+ const auto &PathObfuscator = Options .PathObfuscator ;
1230
+ const auto &PathMapper = Options .DebuggingOptionsPrefixMap ;
1231
1231
const SearchPathOptions &searchPathOpts = M->getASTContext ().SearchPathOpts ;
1232
1232
// Put the framework search paths first so that they'll be preferred upon
1233
1233
// deserialization.
@@ -1242,7 +1242,7 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
1242
1242
// Note: We're not using StringMap here because we don't need to own the
1243
1243
// strings.
1244
1244
llvm::DenseMap<StringRef, unsigned > dependencyDirectories;
1245
- for (auto const &dep : options .Dependencies ) {
1245
+ for (auto const &dep : Options .Dependencies ) {
1246
1246
StringRef directoryName = llvm::sys::path::parent_path (dep.getPath ());
1247
1247
unsigned &dependencyDirectoryIndex = dependencyDirectories[directoryName];
1248
1248
if (!dependencyDirectoryIndex) {
@@ -1259,8 +1259,8 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
1259
1259
llvm::sys::path::filename (dep.getPath ()));
1260
1260
}
1261
1261
1262
- if (!options .ModuleInterface .empty ())
1263
- ModuleInterface.emit (ScratchRecord, options .ModuleInterface );
1262
+ if (!Options .ModuleInterface .empty ())
1263
+ ModuleInterface.emit (ScratchRecord, Options .ModuleInterface );
1264
1264
1265
1265
SmallVector<ImportedModule, 8 > allLocalImports;
1266
1266
M->getImportedModules (allLocalImports, ModuleDecl::getImportFilterLocal ());
@@ -1291,15 +1291,15 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
1291
1291
off_t importedHeaderSize = 0 ;
1292
1292
time_t importedHeaderModTime = 0 ;
1293
1293
std::string contents;
1294
- if (!options .ImportedHeader .empty ()) {
1294
+ if (!Options .ImportedHeader .empty ()) {
1295
1295
contents = clangImporter->getBridgingHeaderContents (
1296
- options .ImportedHeader , importedHeaderSize, importedHeaderModTime);
1296
+ Options .ImportedHeader , importedHeaderSize, importedHeaderModTime);
1297
1297
}
1298
1298
assert (publicImportSet.count (bridgingHeaderImport));
1299
1299
ImportedHeader.emit (ScratchRecord,
1300
1300
publicImportSet.count (bridgingHeaderImport),
1301
1301
importedHeaderSize, importedHeaderModTime,
1302
- options .ImportedHeader );
1302
+ Options .ImportedHeader );
1303
1303
if (!contents.empty ()) {
1304
1304
contents.push_back (' \0 ' );
1305
1305
ImportedHeaderContents.emit (ScratchRecord, contents);
@@ -1348,13 +1348,13 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
1348
1348
}
1349
1349
}
1350
1350
1351
- if (!options .ModuleLinkName .empty ()) {
1351
+ if (!Options .ModuleLinkName .empty ()) {
1352
1352
LinkLibrary.emit (ScratchRecord, serialization::LibraryKind::Library,
1353
- options .AutolinkForceLoad , options .ModuleLinkName );
1353
+ Options .AutolinkForceLoad , Options .ModuleLinkName );
1354
1354
}
1355
- for (auto dependentLib : options .PublicDependentLibraries ) {
1355
+ for (auto dependentLib : Options .PublicDependentLibraries ) {
1356
1356
LinkLibrary.emit (ScratchRecord, serialization::LibraryKind::Library,
1357
- options .AutolinkForceLoad , dependentLib);
1357
+ Options .AutolinkForceLoad , dependentLib);
1358
1358
}
1359
1359
}
1360
1360
@@ -6568,15 +6568,15 @@ void Serializer::writeToStream(
6568
6568
const SILModule *SILMod,
6569
6569
const SerializationOptions &options,
6570
6570
const fine_grained_dependencies::SourceFileDepGraph *DepGraph) {
6571
- Serializer S{SWIFTMODULE_SIGNATURE, DC};
6571
+ Serializer S{SWIFTMODULE_SIGNATURE, DC, options };
6572
6572
6573
6573
// FIXME: This is only really needed for debugging. We don't actually use it.
6574
6574
S.writeBlockInfoBlock ();
6575
6575
6576
6576
{
6577
6577
BCBlockRAII moduleBlock (S.Out , MODULE_BLOCK_ID, 2 );
6578
- S.writeHeader (options );
6579
- S.writeInputBlock (options );
6578
+ S.writeHeader ();
6579
+ S.writeInputBlock ();
6580
6580
S.writeSIL (SILMod, options.SerializeAllSIL );
6581
6581
S.writeAST (DC);
6582
6582
if (!options.DisableCrossModuleIncrementalInfo && DepGraph) {
0 commit comments