Skip to content

Revert "Pass-down -emit-module-semantic-info-path when swift compiler supports this flag" #873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions Sources/SwiftDriver/Driver/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,6 @@ public struct Driver {
/// Path to the Swift module source information file.
let moduleSourceInfoPath: VirtualPath.Handle?

/// Path to the semantic info file for the module.
let moduleSemanticInfoPath: VirtualPath.Handle?

/// Path to the module's digester baseline file.
let digesterBaselinePath: VirtualPath.Handle?

Expand Down Expand Up @@ -707,17 +704,6 @@ public struct Driver {
outputFileMap: self.outputFileMap,
moduleName: moduleOutputInfo.name,
projectDirectory: projectDirectory)

func calculateSemanticInfoPath(_ sourceinfoPath: VirtualPath.Handle?) -> VirtualPath.Handle? {
guard let sourceinfoPath = sourceinfoPath else {
return nil
}
return VirtualPath.lookup(sourceinfoPath)
.replacingExtension(with: .moduleSemanticInfo).intern()
}

// Piggyback semantic info on the source info file.
self.moduleSemanticInfoPath = calculateSemanticInfoPath(self.moduleSourceInfoPath)
self.digesterBaselinePath = try Self.computeDigesterBaselineOutputPath(
&parsedOptions,
moduleOutputPath: self.moduleOutputInfo.output?.outputPath,
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftDriver/Jobs/CompileJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extension Driver {
.privateSwiftInterface, .swiftSourceInfoFile, .diagnostics, .objcHeader, .swiftDeps,
.remap, .tbd, .moduleTrace, .yamlOptimizationRecord, .bitstreamOptimizationRecord, .pcm,
.pch, .clangModuleMap, .jsonCompilerFeatures, .jsonTargetInfo, .jsonSwiftArtifacts,
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, .moduleSemanticInfo, nil:
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, nil:
return false
}
}
Expand Down Expand Up @@ -445,7 +445,7 @@ extension FileType {
.diagnostics, .objcHeader, .image, .swiftDeps, .moduleTrace, .tbd,
.yamlOptimizationRecord, .bitstreamOptimizationRecord, .swiftInterface,
.privateSwiftInterface, .swiftSourceInfoFile, .clangModuleMap, .jsonSwiftArtifacts,
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, .moduleSemanticInfo:
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline:
fatalError("Output type can never be a primary output")
}
}
Expand Down
4 changes: 0 additions & 4 deletions Sources/SwiftDriver/Jobs/EmitModuleJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ extension Driver {
addSupplementalOutput(path: objcGeneratedHeaderPath, flag: "-emit-objc-header-path", type: .objcHeader)
addSupplementalOutput(path: tbdPath, flag: "-emit-tbd-path", type: .tbd)

if isFrontendArgSupported(.emitModuleSemanticInfoPath) {
addSupplementalOutput(path: moduleSemanticInfoPath, flag: "-emit-module-semantic-info-path", type: .moduleSemanticInfo)
}

if isMergeModule {
return
}
Expand Down
14 changes: 4 additions & 10 deletions Sources/SwiftDriver/Utilities/FileType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ public enum FileType: String, Hashable, CaseIterable, Codable {
/// Serialized source information.
case swiftSourceInfoFile = "swiftsourceinfo"

/// module semantic info
case moduleSemanticInfo = "swiftsemanticinfo"

/// Assembler source.
case assembly = "s"

Expand Down Expand Up @@ -152,7 +149,7 @@ extension FileType: CustomStringConvertible {
switch self {
case .swift, .sil, .sib, .image, .dSYM, .dependencies, .autolink,
.swiftModule, .swiftDocumentation, .swiftInterface, .swiftSourceInfoFile, .assembly,
.remap, .tbd, .pcm, .pch, .clangModuleMap, .moduleSemanticInfo:
.remap, .tbd, .pcm, .pch, .clangModuleMap:
return rawValue
case .object:
return "object"
Expand Down Expand Up @@ -239,7 +236,7 @@ extension FileType {
.swiftDeps, .moduleTrace, .tbd, .yamlOptimizationRecord, .bitstreamOptimizationRecord,
.swiftInterface, .privateSwiftInterface, .swiftSourceInfoFile, .jsonDependencies,
.clangModuleMap, .jsonTargetInfo, .jsonCompilerFeatures, .jsonSwiftArtifacts,
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, .moduleSemanticInfo:
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline:
return false
}
}
Expand Down Expand Up @@ -284,8 +281,6 @@ extension FileType {
return "private-swiftinterface"
case .swiftSourceInfoFile:
return "swiftsourceinfo"
case .moduleSemanticInfo:
return "swiftsemanticinfo"
case .clangModuleMap:
return "modulemap"
case .assembly:
Expand Down Expand Up @@ -351,8 +346,7 @@ extension FileType {
.objcHeader, .autolink, .importedModules, .tbd, .moduleTrace,
.yamlOptimizationRecord, .swiftInterface, .privateSwiftInterface,
.jsonDependencies, .clangModuleMap, .jsonCompilerFeatures,
.jsonTargetInfo, .jsonSwiftArtifacts, .jsonAPIBaseline, .jsonABIBaseline,
.moduleSemanticInfo:
.jsonTargetInfo, .jsonSwiftArtifacts, .jsonAPIBaseline, .jsonABIBaseline:
return true
case .image, .object, .dSYM, .pch, .sib, .raw_sib, .swiftModule,
.swiftDocumentation, .swiftSourceInfoFile, .llvmBitcode, .diagnostics,
Expand All @@ -374,7 +368,7 @@ extension FileType {
.importedModules, .tbd, .moduleTrace, .indexData, .yamlOptimizationRecord, .modDepCache,
.bitstreamOptimizationRecord, .pcm, .pch, .jsonDependencies, .clangModuleMap,
.jsonCompilerFeatures, .jsonTargetInfo, .jsonSwiftArtifacts, .indexUnitOutputPath, .jsonAPIBaseline,
.jsonABIBaseline, .moduleSemanticInfo:
.jsonABIBaseline:
return false
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftOptions/ExtraOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extension Option {
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")
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")
public static let emitModuleSeparately: Option = Option("-experimental-emit-module-separately", .flag, attributes: [.helpHidden], helpText: "Emit module files as a distinct job")
public static let noEmitModuleSeparately: Option = Option("-no-emit-module-separately", .flag, attributes: [.helpHidden], helpText: "Force using merge-module as the incremental build mode")
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")

// API digester operations
Expand All @@ -35,6 +36,7 @@ extension Option {
Option.driverScanDependenciesNonLib,
Option.driverWarnUnusedOptions,
Option.emitModuleSeparately,
Option.noEmitModuleSeparately,
Option.useFrontendParseableOutput,
Option.emitDigesterBaseline,
Option.emitDigesterBaselinePath,
Expand Down
Loading