Skip to content

Commit f67037d

Browse files
committed
Add a file type for extracted compile-time-known values
1 parent d8640a2 commit f67037d

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Sources/SwiftDriver/Jobs/CompileJob.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ extension Driver {
9494
.diagnostics, .emitModuleDiagnostics, .objcHeader, .swiftDeps, .remap, .tbd,
9595
.moduleTrace, .yamlOptimizationRecord, .bitstreamOptimizationRecord, .pcm, .pch,
9696
.clangModuleMap, .jsonCompilerFeatures, .jsonTargetInfo, .jsonSwiftArtifacts,
97-
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline, nil:
97+
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline,
98+
.swiftConstValues, nil:
9899
return false
99100
}
100101
}
@@ -459,7 +460,8 @@ extension FileType {
459460
.objcHeader, .image, .swiftDeps, .moduleTrace, .tbd, .yamlOptimizationRecord,
460461
.bitstreamOptimizationRecord, .swiftInterface, .privateSwiftInterface,
461462
.swiftSourceInfoFile, .clangModuleMap, .jsonSwiftArtifacts,
462-
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline:
463+
.indexUnitOutputPath, .modDepCache, .jsonAPIBaseline, .jsonABIBaseline,
464+
.swiftConstValues:
463465
fatalError("Output type can never be a primary output")
464466
}
465467
}

Sources/SwiftDriver/Utilities/FileType.swift

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

60+
/// Extracted compile-time-known values
61+
case swiftConstValues = "swiftconstvalues"
62+
6063
/// Assembler source.
6164
case assembly = "s"
6265

@@ -229,6 +232,9 @@ extension FileType: CustomStringConvertible {
229232

230233
case .jsonABIBaseline:
231234
return "abi-baseline-json"
235+
236+
case .swiftConstValues:
237+
return "const-values"
232238
}
233239
}
234240
}
@@ -248,7 +254,7 @@ extension FileType {
248254
.swiftInterface, .privateSwiftInterface, .swiftSourceInfoFile,
249255
.jsonDependencies, .clangModuleMap, .jsonTargetInfo, .jsonCompilerFeatures,
250256
.jsonSwiftArtifacts, .indexUnitOutputPath, .modDepCache, .jsonAPIBaseline,
251-
.jsonABIBaseline:
257+
.jsonABIBaseline, .swiftConstValues:
252258
return false
253259
}
254260
}
@@ -351,6 +357,8 @@ extension FileType {
351357
return "api-baseline-json"
352358
case .jsonABIBaseline:
353359
return "abi-baseline-json"
360+
case .swiftConstValues:
361+
return "const-values"
354362
}
355363
}
356364
}
@@ -362,7 +370,7 @@ extension FileType {
362370
.raw_sil, .llvmIR,.objcHeader, .autolink, .importedModules, .tbd,
363371
.moduleTrace, .yamlOptimizationRecord, .swiftInterface, .privateSwiftInterface,
364372
.jsonDependencies, .clangModuleMap, .jsonCompilerFeatures, .jsonTargetInfo,
365-
.jsonSwiftArtifacts, .jsonAPIBaseline, .jsonABIBaseline:
373+
.jsonSwiftArtifacts, .jsonAPIBaseline, .jsonABIBaseline, .swiftConstValues:
366374
return true
367375
case .image, .object, .dSYM, .pch, .sib, .raw_sib, .swiftModule,
368376
.swiftDocumentation, .swiftSourceInfoFile, .llvmBitcode, .diagnostics,
@@ -385,7 +393,7 @@ extension FileType {
385393
.importedModules, .tbd, .moduleTrace, .indexData, .yamlOptimizationRecord,
386394
.modDepCache, .bitstreamOptimizationRecord, .pcm, .pch, .jsonDependencies,
387395
.clangModuleMap, .jsonCompilerFeatures, .jsonTargetInfo, .jsonSwiftArtifacts,
388-
.indexUnitOutputPath, .jsonAPIBaseline, .jsonABIBaseline:
396+
.indexUnitOutputPath, .jsonAPIBaseline, .jsonABIBaseline, .swiftConstValues:
389397
return false
390398
}
391399
}

0 commit comments

Comments
 (0)