Skip to content

Commit a1ef380

Browse files
committed
DependencyScan: track library style
Track if the dependency is static or dynamic. This is in preparation for helping rename the static library to differentiate it from import libraries.
1 parent cc9713b commit a1ef380

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/swift/DependencyScan/SerializedModuleDependencyCacheFormat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ using llvm::BCVBR;
4141
const unsigned char MODULE_DEPENDENCY_CACHE_FORMAT_SIGNATURE[] = {'I', 'M', 'D','C'};
4242
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MAJOR = 8;
4343
/// Increment this on every change.
44-
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 0;
44+
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 1;
4545

4646
/// Various identifiers in this format will rely on having their strings mapped
4747
/// using this ID.
@@ -143,6 +143,7 @@ using LinkLibraryLayout =
143143
BCRecordLayout<LINK_LIBRARY_NODE, // ID
144144
IdentifierIDField, // libraryName
145145
IsFrameworkField, // isFramework
146+
IsStaticField, // isStatic
146147
IsForceLoadField // forceLoad
147148
>;
148149
// ACTODO: Comment

lib/DependencyScan/ModuleDependencyCacheSerialization.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ bool ModuleDependenciesCacheDeserializer::readGraph(
324324

325325
case LINK_LIBRARY_NODE: {
326326
unsigned libraryIdentifierID;
327-
bool isFramework, shouldForceLoad;
327+
bool isFramework, isStatic, shouldForceLoad;
328328
LinkLibraryLayout::readRecord(Scratch, libraryIdentifierID, isFramework,
329-
shouldForceLoad);
329+
isStatic, shouldForceLoad);
330330
auto libraryIdentifier = getIdentifier(libraryIdentifierID);
331331
if (!libraryIdentifier)
332332
llvm::report_fatal_error("Bad link library identifier");
@@ -1273,13 +1273,12 @@ void ModuleDependenciesCacheSerializer::writeLinkLibraries(
12731273
unsigned ModuleDependenciesCacheSerializer::writeLinkLibraryInfos(
12741274
const ModuleDependencyInfo &dependencyInfo) {
12751275
using namespace graph_block;
1276-
for (auto &linkLibrary : dependencyInfo.getLinkLibraries()) {
1276+
for (auto &linkLibrary : dependencyInfo.getLinkLibraries())
12771277
LinkLibraryLayout::emitRecord(
12781278
Out, ScratchRecord, AbbrCodes[LinkLibraryLayout::Code],
12791279
getIdentifier(linkLibrary.getName().str()),
12801280
linkLibrary.getKind() == LibraryKind::Framework,
1281-
linkLibrary.shouldForceLoad());
1282-
}
1281+
linkLibrary.isStaticLibrary(), linkLibrary.shouldForceLoad());
12831282
return dependencyInfo.getLinkLibraries().size();
12841283
}
12851284

0 commit comments

Comments
 (0)