mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge main into next - 2021-07-16
Conflicts:
lib/IRGen/IRGenFunction.cpp
Take the changes made in #38386
This commit is contained in:
@@ -232,6 +232,7 @@ void ClangImporter::recordModuleDependencies(
|
||||
while(It != allArgs.end()) {
|
||||
StringRef arg = *It;
|
||||
// Remove the -target arguments because we should use the target triple
|
||||
// specified with `-clang-target` on the scanner invocation, or
|
||||
// from the depending Swift modules.
|
||||
if (arg == "-target") {
|
||||
It += 2;
|
||||
@@ -255,6 +256,16 @@ void ClangImporter::recordModuleDependencies(
|
||||
swiftArgs.push_back(clangArg);
|
||||
}
|
||||
|
||||
// If the scanner is invoked with '-clang-target', ensure this is the target
|
||||
// used to build this PCM.
|
||||
if (Impl.SwiftContext.LangOpts.ClangTarget.hasValue()) {
|
||||
llvm::Triple triple = Impl.SwiftContext.LangOpts.ClangTarget.getValue();
|
||||
swiftArgs.push_back("-Xcc");
|
||||
swiftArgs.push_back("-target");
|
||||
swiftArgs.push_back("-Xcc");
|
||||
swiftArgs.push_back(triple.str());
|
||||
}
|
||||
|
||||
// Swift frontend action: -emit-pcm
|
||||
swiftArgs.push_back("-emit-pcm");
|
||||
swiftArgs.push_back("-module-name");
|
||||
|
||||
Reference in New Issue
Block a user