Skip to content

Commit 598e3e2

Browse files
committed
[Dependency Scanning] Enable scanner-side up-to-date binary module validation on supporting compilers
After ffbae26 landed, it is now safe to enable this behavior.
1 parent a32005e commit 598e3e2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ public extension Driver {
129129
try commandLine.appendLast(.clangScannerModuleCachePath, from: &parsedOptions)
130130
}
131131

132+
if isFrontendArgSupported(.scannerModuleValidation) {
133+
commandLine.appendFlag(.scannerModuleValidation)
134+
}
135+
132136
if isFrontendArgSupported(.scannerPrefixMap) {
133137
// construct `-scanner-prefix-mapper` for scanner.
134138
for (key, value) in prefixMapping {

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
17101710
scannerCommand.removeFirst()
17111711
}
17121712

1713+
if driver.isFrontendArgSupported(.scannerModuleValidation) {
1714+
XCTAssertTrue(scannerCommand.contains("-scanner-module-validation"))
1715+
}
1716+
17131717
// Ensure we do not propagate the usual PCH-handling arguments to the scanner invocation
17141718
XCTAssertFalse(scannerCommand.contains("-pch-output-dir"))
17151719
XCTAssertFalse(scannerCommand.contains("Foo.o"))

0 commit comments

Comments
 (0)