@@ -26,7 +26,7 @@ using namespace mocking_fine_grained_dependency_graphs;
2626void mocking_fine_grained_dependency_graphs::simulateLoad (
2727 ModuleDepGraph &g, const driver::Job *cmd,
2828 const DependencyDescriptions &dependencyDescriptions,
29- StringRef interfaceHashIfNonEmpty,
29+ Optional<Fingerprint> interfaceHashIfNonEmpty,
3030 const bool hadCompilationError) {
3131 const auto changes = getChangesForSimulatedLoad (
3232 g, cmd, dependencyDescriptions, interfaceHashIfNonEmpty,
@@ -38,13 +38,14 @@ ModuleDepGraph::Changes
3838mocking_fine_grained_dependency_graphs::getChangesForSimulatedLoad (
3939 ModuleDepGraph &g, const driver::Job *cmd,
4040 const DependencyDescriptions &dependencyDescriptions,
41- StringRef interfaceHashIfNonEmpty,
41+ Optional<Fingerprint> interfaceHashIfNonEmpty,
4242 const bool hadCompilationError) {
43- StringRef swiftDeps =
44- cmd->getOutput ().getAdditionalOutputForType (file_types::TY_SwiftDeps);
43+ auto swiftDeps =
44+ cmd->getOutput ().getAdditionalOutputForType (file_types::TY_SwiftDeps). str ( );
4545 assert (!swiftDeps.empty ());
46- StringRef interfaceHash =
47- interfaceHashIfNonEmpty.empty () ? swiftDeps : interfaceHashIfNonEmpty;
46+ swiftDeps.resize (Fingerprint::DIGEST_LENGTH, ' X' );
47+ auto interfaceHash =
48+ interfaceHashIfNonEmpty.getValueOr (Fingerprint{swiftDeps});
4849
4950 SourceManager sm;
5051 DiagnosticEngine diags (sm);
@@ -63,7 +64,7 @@ std::vector<const driver::Job *>
6364mocking_fine_grained_dependency_graphs::simulateReload (
6465 ModuleDepGraph &g, const driver::Job *cmd,
6566 const DependencyDescriptions &dependencyDescriptions,
66- StringRef interfaceHashIfNonEmpty,
67+ Optional<Fingerprint> interfaceHashIfNonEmpty,
6768 const bool hadCompilationError) {
6869 const auto changedNodes = getChangesForSimulatedLoad (
6970 g, cmd, dependencyDescriptions, interfaceHashIfNonEmpty,
0 commit comments