[SourceKit] Pass 'swiftc' path to Driver when creating frontend args

Driver uses its path to derive the plugin paths (i.e.
'lib/swift/host/plugins' et al.) Previously it was a constant string
'swiftc' that caused SourceKit failed to find dylib plugins in the
toolchain. Since 'SwiftLangSupport' knows the swift-frontend path,
use it, but replacing the filename with 'swiftc', to derive the plugin
paths.

rdar://107849796
This commit is contained in:
Rintaro Ishizaki
2023-04-11 09:22:32 -07:00
parent 6ec8a8c60f
commit 3517db4c3b
12 changed files with 127 additions and 40 deletions

View File

@@ -31,9 +31,10 @@ compile::SessionManager::getSession(StringRef name) {
}
bool inserted = false;
std::tie(i, inserted) = sessions.try_emplace(
name, std::make_shared<compile::Session>(
RuntimeResourcePath, DiagnosticDocumentationPath, Plugins));
std::tie(i, inserted) =
sessions.try_emplace(name, std::make_shared<compile::Session>(
SwiftExecutablePath, RuntimeResourcePath,
DiagnosticDocumentationPath, Plugins));
assert(inserted);
return i->second;
}