Frontend: Don't append -target-min-inlining-target target to implicit module builds.

When performing an implicit module build, the frontend was prepending
`-target-min-inlining-target target` to the command line. This was overriding
the implicit `-target-min-inlining-target min` argument that is implied when
`-library-level api` is specified. As a result, the wrong overload could be
picked when compiling the body of an inlinable function to SIL for emission
into the client, potentially resulting in crashes when the client of the module
is back deployed to an older OS.

Resolves rdar://109336472
This commit is contained in:
Allan Shortlidge
2023-05-16 14:42:26 -07:00
parent 0594efc0ce
commit 0e7ad1e9a4
7 changed files with 175 additions and 43 deletions

View File

@@ -75,9 +75,27 @@ struct ModuleInterfaceOptions {
extern version::Version InterfaceFormatVersion;
std::string getSwiftInterfaceCompilerVersionForCurrentCompiler(ASTContext &ctx);
/// A regex that matches lines like this:
///
/// // swift-interface-format-version: 1.0
///
/// and extracts "1.0".
llvm::Regex getSwiftInterfaceFormatVersionRegex();
/// A regex that matches lines like this:
///
/// // swift-compiler-version: Apple Swift version 5.8 (swiftlang-5.8.0.117.59)
///
/// and extracts "Apple Swift version 5.8 (swiftlang-5.8.0.117.59)".
llvm::Regex getSwiftInterfaceCompilerVersionRegex();
/// A regex that matches strings like this:
///
/// Apple Swift version 5.8
///
/// and extracts "5.8".
llvm::Regex getSwiftInterfaceCompilerToolsVersionRegex();
/// Emit a stable module interface for \p M, which can be used by a client
/// source file to import this module, subject to options given by \p Opts.
///