From 74ff92d15f227eb5c22632c27baaae489a8e469b Mon Sep 17 00:00:00 2001 From: Kuba Mracek Date: Fri, 16 Feb 2024 10:52:22 -0800 Subject: [PATCH 1/2] Propagate the -no-allocations frontend flag to the frontend --- Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift index c5d6a099b..1448fbf88 100644 --- a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift +++ b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift @@ -254,6 +254,7 @@ extension Driver { try commandLine.appendAll(.debugPrefixMap, .coveragePrefixMap, .filePrefixMap, from: &parsedOptions) try commandLine.appendAllArguments(.Xfrontend, from: &parsedOptions) try commandLine.appendLast(.warnConcurrency, from: &parsedOptions) + try commandLine.appendLast(.noAllocations, from: &parsedOptions) if isFrontendArgSupported(.enableExperimentalFeature) { try commandLine.appendAll( .enableExperimentalFeature, from: &parsedOptions) From cc74efec7fea91464401c7a69c7b63fac983d14e Mon Sep 17 00:00:00 2001 From: Kuba Mracek Date: Fri, 16 Feb 2024 14:39:49 -0800 Subject: [PATCH 2/2] Use isFrontendArgSupported() to guard the -no-allocations flag --- Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift index 1448fbf88..139bda0f8 100644 --- a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift +++ b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift @@ -254,7 +254,9 @@ extension Driver { try commandLine.appendAll(.debugPrefixMap, .coveragePrefixMap, .filePrefixMap, from: &parsedOptions) try commandLine.appendAllArguments(.Xfrontend, from: &parsedOptions) try commandLine.appendLast(.warnConcurrency, from: &parsedOptions) - try commandLine.appendLast(.noAllocations, from: &parsedOptions) + if isFrontendArgSupported(.noAllocations) { + try commandLine.appendLast(.noAllocations, from: &parsedOptions) + } if isFrontendArgSupported(.enableExperimentalFeature) { try commandLine.appendAll( .enableExperimentalFeature, from: &parsedOptions)