@@ -1220,7 +1220,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1220
1220
getFrameworkSearchPaths (), framework_search_paths,
1221
1221
.Path );
1222
1222
1223
- std::vector<swift::PluginSearchOption::Value > plugin_search_options;
1223
+ std::vector<swift::PluginSearchOption> plugin_search_options;
1224
1224
llvm::StringSet<> known_plugin_search_paths;
1225
1225
llvm::StringSet<> known_external_plugin_search_paths;
1226
1226
llvm::StringSet<> known_compiler_plugin_library_paths;
@@ -1312,7 +1312,8 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1312
1312
};
1313
1313
1314
1314
for (auto &opt : extended_validation_info.getPluginSearchOptions ()) {
1315
- if (opt.first == " -plugin-path" ) {
1315
+ switch (opt.first ) {
1316
+ case swift::PluginSearchOption::Kind::PluginPath: {
1316
1317
StringRef path = opt.second ;
1317
1318
// System plugins shipping with the compiler.
1318
1319
// Rewrite them to go through an ABI-compatible swift-plugin-server.
@@ -1330,7 +1331,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1330
1331
}
1331
1332
continue ;
1332
1333
}
1333
- if (opt. first == " -external-plugin-path " ) {
1334
+ case swift::PluginSearchOption::Kind::ExternalPluginPath: {
1334
1335
// Sandboxed system plugins shipping with some compiler.
1335
1336
// Keep the original plugin server path, it needs to be ABI
1336
1337
// compatible with the version of SwiftSyntax used by the plugin.
@@ -1347,7 +1348,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1347
1348
server});
1348
1349
continue ;
1349
1350
}
1350
- if (opt. first == " -load-plugin-library " ) {
1351
+ case swift::PluginSearchOption::Kind::LoadPluginLibrary: {
1351
1352
// Compiler plugin libraries.
1352
1353
StringRef dylib = opt.second ;
1353
1354
if (known_compiler_plugin_library_paths.insert (dylib).second )
@@ -1375,7 +1376,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1375
1376
}
1376
1377
continue ;
1377
1378
}
1378
- if (opt. first == " -load-plugin-executable " ) {
1379
+ case swift::PluginSearchOption::Kind::LoadPluginExecutable: {
1379
1380
// Compiler plugin executables.
1380
1381
auto plugin_modules = opt.second .split (' #' );
1381
1382
llvm::StringRef plugin = plugin_modules.first ;
@@ -1393,6 +1394,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1393
1394
plugin.str (), modules_vec});
1394
1395
continue ;
1395
1396
}
1397
+ }
1396
1398
llvm_unreachable (" unhandled plugin search option kind" );
1397
1399
}
1398
1400
@@ -2022,7 +2024,7 @@ static void ProcessModule(
2022
2024
ModuleSP module_sp, std::string m_description,
2023
2025
bool discover_implicit_search_paths, bool use_all_compiler_flags,
2024
2026
Target &target, llvm::Triple triple,
2025
- std::vector<swift::PluginSearchOption::Value > &plugin_search_options,
2027
+ std::vector<swift::PluginSearchOption> &plugin_search_options,
2026
2028
std::vector<std::string> &module_search_paths,
2027
2029
std::vector<std::pair<std::string, bool >> &framework_search_paths,
2028
2030
std::vector<std::string> &extra_clang_args) {
@@ -2168,7 +2170,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
2168
2170
2169
2171
LLDB_SCOPED_TIMER ();
2170
2172
std::string m_description = " SwiftASTContextForExpressions" ;
2171
- std::vector<swift::PluginSearchOption::Value > plugin_search_options;
2173
+ std::vector<swift::PluginSearchOption> plugin_search_options;
2172
2174
std::vector<std::string> module_search_paths;
2173
2175
std::vector<std::pair<std::string, bool >> framework_search_paths;
2174
2176
TargetSP target_sp = typeref_typesystem.GetTargetWP ().lock ();
@@ -4633,7 +4635,7 @@ void SwiftASTContextForExpressions::ModulesDidLoad(ModuleList &module_list) {
4633
4635
bool use_all_compiler_flags = target_sp->GetUseAllCompilerFlags ();
4634
4636
unsigned num_images = module_list.GetSize ();
4635
4637
for (size_t mi = 0 ; mi != num_images; ++mi) {
4636
- std::vector<swift::PluginSearchOption::Value > plugin_search_options;
4638
+ std::vector<swift::PluginSearchOption> plugin_search_options;
4637
4639
std::vector<std::string> module_search_paths;
4638
4640
std::vector<std::pair<std::string, bool >> framework_search_paths;
4639
4641
std::vector<std::string> extra_clang_args;
0 commit comments