@@ -1272,15 +1272,15 @@ bool swift::dependencies::scanDependencies(CompilerInstance &instance) {
12721272 std::string path = opts.InputsAndOutputs .getSingleOutputFilename ();
12731273 // `-scan-dependencies` invocations use a single new instance
12741274 // of a module cache
1275- SwiftDependencyScanningService service;
1275+ SwiftDependencyScanningService * service = Context. Allocate <SwiftDependencyScanningService>() ;
12761276 if (opts.ReuseDependencyScannerCache )
1277- deserializeDependencyCache (instance, service);
1277+ deserializeDependencyCache (instance, * service);
12781278
1279- if (service. setupCachingDependencyScanningService (instance))
1279+ if (service-> setupCachingDependencyScanningService (instance))
12801280 return true ;
12811281
12821282 ModuleDependenciesCache cache (
1283- service, instance.getMainModule ()->getNameStr ().str (),
1283+ * service, instance.getMainModule ()->getNameStr ().str (),
12841284 instance.getInvocation ().getFrontendOptions ().ExplicitModulesOutputPath ,
12851285 instance.getInvocation ().getModuleScanningHash ());
12861286
@@ -1291,7 +1291,7 @@ bool swift::dependencies::scanDependencies(CompilerInstance &instance) {
12911291 // Serialize the dependency cache if -serialize-dependency-scan-cache
12921292 // is specified
12931293 if (opts.SerializeDependencyScannerCache )
1294- serializeDependencyCache (instance, service);
1294+ serializeDependencyCache (instance, * service);
12951295
12961296 if (dependenciesOrErr.getError ())
12971297 return true ;
@@ -1315,9 +1315,9 @@ bool swift::dependencies::prescanDependencies(CompilerInstance &instance) {
13151315 std::string path = opts.InputsAndOutputs .getSingleOutputFilename ();
13161316 // `-scan-dependencies` invocations use a single new instance
13171317 // of a module cache
1318- SwiftDependencyScanningService singleUseService;
1318+ SwiftDependencyScanningService * singleUseService = Context. Allocate <SwiftDependencyScanningService>() ;
13191319 ModuleDependenciesCache cache (
1320- singleUseService, instance.getMainModule ()->getNameStr ().str (),
1320+ * singleUseService, instance.getMainModule ()->getNameStr ().str (),
13211321 instance.getInvocation ().getFrontendOptions ().ExplicitModulesOutputPath ,
13221322 instance.getInvocation ().getModuleScanningHash ());
13231323
0 commit comments