From fb7408bd63a8d0cb695155a678d72d0dc6f5acc7 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 23 Oct 2025 11:59:16 +0200 Subject: [PATCH] Swift: Handle `-emit-module` in the tracer config --- swift/tools/tracing-config.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/swift/tools/tracing-config.lua b/swift/tools/tracing-config.lua index 15effc0140b5..5639a525a85d 100644 --- a/swift/tools/tracing-config.lua +++ b/swift/tools/tracing-config.lua @@ -99,13 +99,15 @@ function RegisterExtractorPack(id) if compilerName ~= 'swift-frontend' then return nil end - -- Skip the invocation in case it's not called in `-frontend` mode - if compilerArguments.argv[1] ~= '-frontend' then + -- Skip the invocation in case it's not called in `-frontend` or `-emit-module` mode + if compilerArguments.argv[1] ~= '-frontend' and compilerArguments.argv[1] ~= '-emit-module' then return nil end -- Drop the `-frontend` argument - table.remove(compilerArguments.argv, 1) + if compilerArguments.argv[1] == '-frontend' then + table.remove(compilerArguments.argv, 1) + end -- Skip "info" queries in case there is nothing to extract if compilerArguments.argv[1] == '-print-target-info' then