@@ -1301,6 +1301,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1301
1301
llvm::StringSet<> known_external_plugin_search_paths;
1302
1302
llvm::StringSet<> known_compiler_plugin_library_paths;
1303
1303
llvm::StringSet<> known_compiler_plugin_executable_paths;
1304
+ llvm::StringSet<> known_resolved_plugin_configs;
1304
1305
for (auto &elem : search_path_options.PluginSearchOpts ) {
1305
1306
plugin_search_options.push_back (elem);
1306
1307
@@ -1480,6 +1481,25 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1480
1481
plugin.str (), modules_vec});
1481
1482
continue ;
1482
1483
}
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
+ }
1483
1503
}
1484
1504
llvm_unreachable (" unhandled plugin search option kind" );
1485
1505
}
0 commit comments