AST,DependencyScan,IRGen,Serialization,Tooling: track library style (#78777)

Track if the dependency is static or dynamic. This is in preparation for
helping rename the static library to differentiate it from import
libraries.
This commit is contained in:
Saleem Abdulrasool
2025-02-06 13:22:56 -08:00
committed by GitHub
parent 8d69807ed6
commit 9c85fbc8da
26 changed files with 158 additions and 96 deletions

View File

@@ -354,17 +354,18 @@ bool ModuleDependenciesCacheDeserializer::readGraph(
case LINK_LIBRARY_NODE: {
unsigned libraryIdentifierID;
bool isFramework, shouldForceLoad;
bool isFramework, isStatic, shouldForceLoad;
LinkLibraryLayout::readRecord(Scratch, libraryIdentifierID, isFramework,
shouldForceLoad);
isStatic, shouldForceLoad);
auto libraryIdentifier = getIdentifier(libraryIdentifierID);
if (!libraryIdentifier)
llvm::report_fatal_error("Bad link library identifier");
LinkLibraries.push_back(LinkLibrary(libraryIdentifier.value(),
isFramework ? LibraryKind::Framework
: LibraryKind::Library,
shouldForceLoad));
LinkLibraries.emplace_back(
libraryIdentifier.value(),
isFramework ? LibraryKind::Framework
: LibraryKind::Library,
isStatic, shouldForceLoad);
break;
}
@@ -1311,13 +1312,12 @@ void ModuleDependenciesCacheSerializer::writeLinkLibraries(
unsigned ModuleDependenciesCacheSerializer::writeLinkLibraryInfos(
const ModuleDependencyInfo &dependencyInfo) {
using namespace graph_block;
for (auto &linkLibrary : dependencyInfo.getLinkLibraries()) {
for (auto &linkLibrary : dependencyInfo.getLinkLibraries())
LinkLibraryLayout::emitRecord(
Out, ScratchRecord, AbbrCodes[LinkLibraryLayout::Code],
getIdentifier(linkLibrary.getName().str()),
linkLibrary.getKind() == LibraryKind::Framework,
linkLibrary.shouldForceLoad());
}
linkLibrary.isStaticLibrary(), linkLibrary.shouldForceLoad());
return dependencyInfo.getLinkLibraries().size();
}