mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge 'origin/main' into rebranch - 2021-07-16
Conflicts:
lib/IRGen/IRGenFunction.cpp
Take the changes made in #38386
This commit is contained in:
@@ -1648,15 +1648,20 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
|
||||
}
|
||||
info.BuildArguments = BuildArgs;
|
||||
info.Hash = CacheHash;
|
||||
auto target = *(std::find(BuildArgs.rbegin(), BuildArgs.rend(), "-target") - 1);
|
||||
auto target = *(std::find(BuildArgs.rbegin(), BuildArgs.rend(), "-target") - 1);
|
||||
auto langVersion = *(std::find(BuildArgs.rbegin(), BuildArgs.rend(),
|
||||
"-swift-version") - 1);
|
||||
std::array<StringRef, 6> ExtraPCMArgs = {
|
||||
// PCMs should use the target triple the interface will be using to build
|
||||
"-Xcc", "-target", "-Xcc", target,
|
||||
|
||||
std::vector<StringRef> ExtraPCMArgs = {
|
||||
// PCMs should use the effective Swift language version for apinotes.
|
||||
"-Xcc", ArgSaver.save((llvm::Twine("-fapinotes-swift-version=") + langVersion).str())
|
||||
"-Xcc",
|
||||
ArgSaver.save((llvm::Twine("-fapinotes-swift-version=") + langVersion).str())
|
||||
};
|
||||
if (!subInvocation.getLangOptions().ClangTarget.hasValue()) {
|
||||
ExtraPCMArgs.insert(ExtraPCMArgs.begin(), {"-Xcc", "-target",
|
||||
"-Xcc", target});
|
||||
}
|
||||
|
||||
info.ExtraPCMArgs = ExtraPCMArgs;
|
||||
// Run the action under the sub compiler instance.
|
||||
return action(info);
|
||||
|
||||
Reference in New Issue
Block a user