@@ -1216,15 +1216,15 @@ bool swift::dependencies::scanDependencies(CompilerInstance &instance) {
12161216 std::string path = opts.InputsAndOutputs .getSingleOutputFilename ();
12171217 // `-scan-dependencies` invocations use a single new instance
12181218 // of a module cache
1219- SwiftDependencyScanningService service;
1219+ SwiftDependencyScanningService * service = Context. Allocate <SwiftDependencyScanningService>() ;
12201220 if (opts.ReuseDependencyScannerCache )
1221- deserializeDependencyCache (instance, service);
1221+ deserializeDependencyCache (instance, * service);
12221222
1223- if (service. setupCachingDependencyScanningService (instance))
1223+ if (service-> setupCachingDependencyScanningService (instance))
12241224 return true ;
12251225
12261226 ModuleDependenciesCache cache (
1227- service, instance.getMainModule ()->getNameStr ().str (),
1227+ * service, instance.getMainModule ()->getNameStr ().str (),
12281228 instance.getInvocation ().getFrontendOptions ().ExplicitModulesOutputPath ,
12291229 instance.getInvocation ().getModuleScanningHash ());
12301230
@@ -1235,7 +1235,7 @@ bool swift::dependencies::scanDependencies(CompilerInstance &instance) {
12351235 // Serialize the dependency cache if -serialize-dependency-scan-cache
12361236 // is specified
12371237 if (opts.SerializeDependencyScannerCache )
1238- serializeDependencyCache (instance, service);
1238+ serializeDependencyCache (instance, * service);
12391239
12401240 if (dependenciesOrErr.getError ())
12411241 return true ;
@@ -1259,9 +1259,9 @@ bool swift::dependencies::prescanDependencies(CompilerInstance &instance) {
12591259 std::string path = opts.InputsAndOutputs .getSingleOutputFilename ();
12601260 // `-scan-dependencies` invocations use a single new instance
12611261 // of a module cache
1262- SwiftDependencyScanningService singleUseService;
1262+ SwiftDependencyScanningService * singleUseService = Context. Allocate <SwiftDependencyScanningService>() ;
12631263 ModuleDependenciesCache cache (
1264- singleUseService, instance.getMainModule ()->getNameStr ().str (),
1264+ * singleUseService, instance.getMainModule ()->getNameStr ().str (),
12651265 instance.getInvocation ().getFrontendOptions ().ExplicitModulesOutputPath ,
12661266 instance.getInvocation ().getModuleScanningHash ());
12671267
0 commit comments