From 200563c2e60d6940f73839d284a8b22c90f1c86c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 21 Jul 2023 04:30:05 -0700 Subject: [PATCH] Option: add `-libc` as an option for Swift tools Ensure that we process `-libc` in `swift-symbolgraph-extract` and `swift-api-extract`. This option is used by Windows to determine the C ABI to use and thus impacts the ABI exposed by the ClangImporter to the Swift interface. This partially enables the use of `swift package dump-symbol-graph` on Windows. --- include/swift/Option/Options.td | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/swift/Option/Options.td b/include/swift/Option/Options.td index fff81d54a723b..ad68f6a6d13e8 100644 --- a/include/swift/Option/Options.td +++ b/include/swift/Option/Options.td @@ -834,7 +834,9 @@ def enable_app_extension : Flag<["-"], "application-extension">, Flags<[FrontendOption, NoInteractiveOption]>, HelpText<"Restrict code to those available for App Extensions">; -def libc : Separate<["-"], "libc">, HelpText<"libc runtime library to use">; +def libc : Separate<["-"], "libc">, + Flags<[SwiftAPIExtractOption, SwiftSymbolGraphExtractOption]>, + HelpText<"libc runtime library to use">; // Linker options