Skip to content

Commit 71d2efc

Browse files
authored
Revert "Pass-down -emit-module-semantic-info-path when swift compiler supports this flag"
1 parent bba7d01 commit 71d2efc

File tree

6 files changed

+9
-65
lines changed

6 files changed

+9
-65
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ public struct Driver {
300300
/// Path to the Swift module source information file.
301301
let moduleSourceInfoPath: VirtualPath.Handle?
302302

303-
/// Path to the semantic info file for the module.
304-
let moduleSemanticInfoPath: VirtualPath.Handle?
305-
306303
/// Path to the module's digester baseline file.
307304
let digesterBaselinePath: VirtualPath.Handle?
308305

@@ -707,17 +704,6 @@ public struct Driver {
707704
outputFileMap: self.outputFileMap,
708705
moduleName: moduleOutputInfo.name,
709706
projectDirectory: projectDirectory)
710-
711-
func calculateSemanticInfoPath(_ sourceinfoPath: VirtualPath.Handle?) -> VirtualPath.Handle? {
712-
guard let sourceinfoPath = sourceinfoPath else {
713-
return nil
714-
}
715-
return VirtualPath.lookup(sourceinfoPath)
716-
.replacingExtension(with: .moduleSemanticInfo).intern()
717-
}
718-
719-
// Piggyback semantic info on the source info file.
720-
self.moduleSemanticInfoPath = calculateSemanticInfoPath(self.moduleSourceInfoPath)
721707
self.digesterBaselinePath = try Self.computeDigesterBaselineOutputPath(
722708
&parsedOptions,
723709
moduleOutputPath: self.moduleOutputInfo.output?.outputPath,

Sources/SwiftDriver/Jobs/CompileJob.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extension Driver {
9393
.privateSwiftInterface, .swiftSourceInfoFile, .diagnostics, .objcHeader, .swiftDeps,
9494
.remap, .tbd, .moduleTrace, .yamlOptimizationRecord, .bitstreamOptimizationRecord, .pcm,
9595
.pch, .clangModuleMap, .jsonCompilerFeatures, .jsonTargetInfo, .jsonSwiftArtifacts,
96-
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, .moduleSemanticInfo, nil:
96+
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, nil:
9797
return false
9898
}
9999
}
@@ -445,7 +445,7 @@ extension FileType {
445445
.diagnostics, .objcHeader, .image, .swiftDeps, .moduleTrace, .tbd,
446446
.yamlOptimizationRecord, .bitstreamOptimizationRecord, .swiftInterface,
447447
.privateSwiftInterface, .swiftSourceInfoFile, .clangModuleMap, .jsonSwiftArtifacts,
448-
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, .moduleSemanticInfo:
448+
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline:
449449
fatalError("Output type can never be a primary output")
450450
}
451451
}

Sources/SwiftDriver/Jobs/EmitModuleJob.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ extension Driver {
3333
addSupplementalOutput(path: objcGeneratedHeaderPath, flag: "-emit-objc-header-path", type: .objcHeader)
3434
addSupplementalOutput(path: tbdPath, flag: "-emit-tbd-path", type: .tbd)
3535

36-
if isFrontendArgSupported(.emitModuleSemanticInfoPath) {
37-
addSupplementalOutput(path: moduleSemanticInfoPath, flag: "-emit-module-semantic-info-path", type: .moduleSemanticInfo)
38-
}
39-
4036
if isMergeModule {
4137
return
4238
}

Sources/SwiftDriver/Utilities/FileType.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ public enum FileType: String, Hashable, CaseIterable, Codable {
5757
/// Serialized source information.
5858
case swiftSourceInfoFile = "swiftsourceinfo"
5959

60-
/// module semantic info
61-
case moduleSemanticInfo = "swiftsemanticinfo"
62-
6360
/// Assembler source.
6461
case assembly = "s"
6562

@@ -152,7 +149,7 @@ extension FileType: CustomStringConvertible {
152149
switch self {
153150
case .swift, .sil, .sib, .image, .dSYM, .dependencies, .autolink,
154151
.swiftModule, .swiftDocumentation, .swiftInterface, .swiftSourceInfoFile, .assembly,
155-
.remap, .tbd, .pcm, .pch, .clangModuleMap, .moduleSemanticInfo:
152+
.remap, .tbd, .pcm, .pch, .clangModuleMap:
156153
return rawValue
157154
case .object:
158155
return "object"
@@ -239,7 +236,7 @@ extension FileType {
239236
.swiftDeps, .moduleTrace, .tbd, .yamlOptimizationRecord, .bitstreamOptimizationRecord,
240237
.swiftInterface, .privateSwiftInterface, .swiftSourceInfoFile, .jsonDependencies,
241238
.clangModuleMap, .jsonTargetInfo, .jsonCompilerFeatures, .jsonSwiftArtifacts,
242-
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, .moduleSemanticInfo:
239+
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline:
243240
return false
244241
}
245242
}
@@ -284,8 +281,6 @@ extension FileType {
284281
return "private-swiftinterface"
285282
case .swiftSourceInfoFile:
286283
return "swiftsourceinfo"
287-
case .moduleSemanticInfo:
288-
return "swiftsemanticinfo"
289284
case .clangModuleMap:
290285
return "modulemap"
291286
case .assembly:
@@ -351,8 +346,7 @@ extension FileType {
351346
.objcHeader, .autolink, .importedModules, .tbd, .moduleTrace,
352347
.yamlOptimizationRecord, .swiftInterface, .privateSwiftInterface,
353348
.jsonDependencies, .clangModuleMap, .jsonCompilerFeatures,
354-
.jsonTargetInfo, .jsonSwiftArtifacts, .jsonAPIBaseline, .jsonABIBaseline,
355-
.moduleSemanticInfo:
349+
.jsonTargetInfo, .jsonSwiftArtifacts, .jsonAPIBaseline, .jsonABIBaseline:
356350
return true
357351
case .image, .object, .dSYM, .pch, .sib, .raw_sib, .swiftModule,
358352
.swiftDocumentation, .swiftSourceInfoFile, .llvmBitcode, .diagnostics,
@@ -374,7 +368,7 @@ extension FileType {
374368
.importedModules, .tbd, .moduleTrace, .indexData, .yamlOptimizationRecord, .modDepCache,
375369
.bitstreamOptimizationRecord, .pcm, .pch, .jsonDependencies, .clangModuleMap,
376370
.jsonCompilerFeatures, .jsonTargetInfo, .jsonSwiftArtifacts, .indexUnitOutputPath, .jsonAPIBaseline,
377-
.jsonABIBaseline, .moduleSemanticInfo:
371+
.jsonABIBaseline:
378372
return false
379373
}
380374
}

Sources/SwiftOptions/ExtraOptions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extension Option {
1717
public static let driverScanDependenciesNonLib: Option = Option("-nonlib-dependency-scanner", .flag, attributes: [.helpHidden], helpText: "Use calls to `swift-frontend -scan-dependencies` instead of dedicated dependency scanning library")
1818
public static let driverWarnUnusedOptions: Option = Option("-driver-warn-unused-options", .flag, attributes: [.helpHidden], helpText: "Emit warnings for any provided options which are unused by the driver")
1919
public static let emitModuleSeparately: Option = Option("-experimental-emit-module-separately", .flag, attributes: [.helpHidden], helpText: "Emit module files as a distinct job")
20+
public static let noEmitModuleSeparately: Option = Option("-no-emit-module-separately", .flag, attributes: [.helpHidden], helpText: "Force using merge-module as the incremental build mode")
2021
public static let useFrontendParseableOutput: Option = Option("-use-frontend-parseable-output", .flag, attributes: [.helpHidden], helpText: "Emit parseable-output from swift-frontend jobs instead of from the driver")
2122

2223
// API digester operations
@@ -35,6 +36,7 @@ extension Option {
3536
Option.driverScanDependenciesNonLib,
3637
Option.driverWarnUnusedOptions,
3738
Option.emitModuleSeparately,
39+
Option.noEmitModuleSeparately,
3840
Option.useFrontendParseableOutput,
3941
Option.emitDigesterBaseline,
4042
Option.emitDigesterBaselinePath,

0 commit comments

Comments
 (0)