Merge 'origin/main' into rebranch - 2021-07-16

Conflicts:
	lib/IRGen/IRGenFunction.cpp
    Take the changes made in #38386
This commit is contained in:
Eric Miotto
2021-07-16 07:57:06 -07:00
32 changed files with 702 additions and 296 deletions

View File

@@ -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);