mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #76732 from cachemeifyoucan/eng/PR-136682810
[Macro] Precise macro plugin dependency during scanning
This commit is contained in:
@@ -2172,6 +2172,27 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,
|
||||
resolveSearchPath(dylibPath), resolveSearchPath(serverPath)});
|
||||
break;
|
||||
}
|
||||
case OPT_load_resolved_plugin: {
|
||||
StringRef libraryPath;
|
||||
StringRef executablePath;
|
||||
StringRef modulesStr;
|
||||
std::tie(libraryPath, executablePath) =
|
||||
StringRef(A->getValue()).split('#');
|
||||
std::tie(executablePath, modulesStr) = executablePath.split('#');
|
||||
if (modulesStr.empty() ||
|
||||
(libraryPath.empty() && executablePath.empty())) {
|
||||
Diags.diagnose(SourceLoc(), diag::error_load_resolved_plugin,
|
||||
A->getValue());
|
||||
}
|
||||
std::vector<std::string> moduleNames;
|
||||
for (auto name : llvm::split(modulesStr, ',')) {
|
||||
moduleNames.emplace_back(name);
|
||||
}
|
||||
Opts.PluginSearchOpts.emplace_back(
|
||||
PluginSearchOption::ResolvedPluginConfig{
|
||||
libraryPath.str(), executablePath.str(), std::move(moduleNames)});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
llvm_unreachable("unhandled plugin search option");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user