From a9ebc066d28a9f5d965e2b2ebb48e8764349ac48 Mon Sep 17 00:00:00 2001 From: Ryan Mansfield Date: Tue, 9 Jul 2024 11:52:04 -0400 Subject: [PATCH] When specified pass -suppress-remarks to frontend. Fixes https://github.com/swiftlang/swift/issues/72924 --- Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift | 1 + Tests/SwiftDriverTests/SwiftDriverTests.swift | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift index d33fb9761..c138ad1e8 100644 --- a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift +++ b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift @@ -220,6 +220,7 @@ extension Driver { try commandLine.appendLast(.remarkLoadingModule, from: &parsedOptions) try commandLine.appendLast(.RpassEQ, from: &parsedOptions) try commandLine.appendLast(.RpassMissedEQ, from: &parsedOptions) + try commandLine.appendLast(.suppressRemarks, from: &parsedOptions) try commandLine.appendLast(.suppressWarnings, from: &parsedOptions) try commandLine.appendLast(.profileGenerate, from: &parsedOptions) try commandLine.appendLast(.profileUse, from: &parsedOptions) diff --git a/Tests/SwiftDriverTests/SwiftDriverTests.swift b/Tests/SwiftDriverTests/SwiftDriverTests.swift index 6c6da824e..be0992b4e 100644 --- a/Tests/SwiftDriverTests/SwiftDriverTests.swift +++ b/Tests/SwiftDriverTests/SwiftDriverTests.swift @@ -5586,12 +5586,13 @@ final class SwiftDriverTests: XCTestCase { } do { - var driver = try Driver(args: ["swift", "-warnings-as-errors", "-no-warnings-as-errors", "-suppress-warnings", "foo.swift"]) + var driver = try Driver(args: ["swift", "-warnings-as-errors", "-no-warnings-as-errors", "-suppress-warnings", "-suppress-remarks", "foo.swift"]) let plannedJobs = try driver.planBuild() XCTAssertEqual(plannedJobs.count, 1) let job = plannedJobs[0] XCTAssertTrue(job.commandLine.contains(.flag("-no-warnings-as-errors"))) XCTAssertTrue(job.commandLine.contains(.flag("-suppress-warnings"))) + XCTAssertTrue(job.commandLine.contains(.flag("-suppress-remarks"))) } do {