Skip to content

Commit 240db8d

Browse files
[lldb] Update lldb for new swift plugin search option
1 parent 2904031 commit 240db8d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13011301
llvm::StringSet<> known_external_plugin_search_paths;
13021302
llvm::StringSet<> known_compiler_plugin_library_paths;
13031303
llvm::StringSet<> known_compiler_plugin_executable_paths;
1304+
llvm::StringSet<> known_resolved_plugin_configs;
13041305
for (auto &elem : search_path_options.PluginSearchOpts) {
13051306
plugin_search_options.push_back(elem);
13061307

@@ -1480,6 +1481,25 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
14801481
plugin.str(), modules_vec});
14811482
continue;
14821483
}
1484+
case swift::PluginSearchOption::Kind::ResolvedPluginConfig: {
1485+
// Resolved plugin config.
1486+
StringRef lib_path;
1487+
StringRef exe_path;
1488+
StringRef modules_list;
1489+
std::tie(lib_path, exe_path) = opt.second.split('#');
1490+
std::tie(exe_path, modules_list) = exe_path.split('#');
1491+
std::vector<std::string> modules_vec;
1492+
for (auto name : llvm::split(modules_list, ','))
1493+
modules_vec.emplace_back(name);
1494+
if (known_resolved_plugin_configs.insert(opt.second).second)
1495+
if ((lib_path.empty() || exists(lib_path)) &&
1496+
(exe_path.empty() || exists(exe_path)))
1497+
plugin_search_options.emplace_back(
1498+
swift::PluginSearchOption::ResolvedPluginConfig{
1499+
lib_path.str(), exe_path.str(),
1500+
std::move(modules_vec)});
1501+
continue;
1502+
}
14831503
}
14841504
llvm_unreachable("unhandled plugin search option kind");
14851505
}

0 commit comments

Comments
 (0)