Skip to content

Commit 93d4f9b

Browse files
committed
[Swift/Macros] Update for PluginSearchOption::Kind
1 parent 7231605 commit 93d4f9b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
12201220
getFrameworkSearchPaths(), framework_search_paths,
12211221
.Path);
12221222

1223-
std::vector<swift::PluginSearchOption::Value> plugin_search_options;
1223+
std::vector<swift::PluginSearchOption> plugin_search_options;
12241224
llvm::StringSet<> known_plugin_search_paths;
12251225
llvm::StringSet<> known_external_plugin_search_paths;
12261226
llvm::StringSet<> known_compiler_plugin_library_paths;
@@ -1312,7 +1312,8 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13121312
};
13131313

13141314
for (auto &opt : extended_validation_info.getPluginSearchOptions()) {
1315-
if (opt.first == "-plugin-path") {
1315+
switch (opt.first) {
1316+
case swift::PluginSearchOption::Kind::PluginPath: {
13161317
StringRef path = opt.second;
13171318
// System plugins shipping with the compiler.
13181319
// Rewrite them to go through an ABI-compatible swift-plugin-server.
@@ -1330,7 +1331,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13301331
}
13311332
continue;
13321333
}
1333-
if (opt.first == "-external-plugin-path") {
1334+
case swift::PluginSearchOption::Kind::ExternalPluginPath: {
13341335
// Sandboxed system plugins shipping with some compiler.
13351336
// Keep the original plugin server path, it needs to be ABI
13361337
// compatible with the version of SwiftSyntax used by the plugin.
@@ -1347,7 +1348,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13471348
server});
13481349
continue;
13491350
}
1350-
if (opt.first == "-load-plugin-library") {
1351+
case swift::PluginSearchOption::Kind::LoadPluginLibrary: {
13511352
// Compiler plugin libraries.
13521353
StringRef dylib = opt.second;
13531354
if (known_compiler_plugin_library_paths.insert(dylib).second)
@@ -1375,7 +1376,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13751376
}
13761377
continue;
13771378
}
1378-
if (opt.first == "-load-plugin-executable") {
1379+
case swift::PluginSearchOption::Kind::LoadPluginExecutable: {
13791380
// Compiler plugin executables.
13801381
auto plugin_modules = opt.second.split('#');
13811382
llvm::StringRef plugin = plugin_modules.first;
@@ -1393,6 +1394,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13931394
plugin.str(), modules_vec});
13941395
continue;
13951396
}
1397+
}
13961398
llvm_unreachable("unhandled plugin search option kind");
13971399
}
13981400

@@ -2022,7 +2024,7 @@ static void ProcessModule(
20222024
ModuleSP module_sp, std::string m_description,
20232025
bool discover_implicit_search_paths, bool use_all_compiler_flags,
20242026
Target &target, llvm::Triple triple,
2025-
std::vector<swift::PluginSearchOption::Value> &plugin_search_options,
2027+
std::vector<swift::PluginSearchOption> &plugin_search_options,
20262028
std::vector<std::string> &module_search_paths,
20272029
std::vector<std::pair<std::string, bool>> &framework_search_paths,
20282030
std::vector<std::string> &extra_clang_args) {
@@ -2168,7 +2170,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
21682170

21692171
LLDB_SCOPED_TIMER();
21702172
std::string m_description = "SwiftASTContextForExpressions";
2171-
std::vector<swift::PluginSearchOption::Value> plugin_search_options;
2173+
std::vector<swift::PluginSearchOption> plugin_search_options;
21722174
std::vector<std::string> module_search_paths;
21732175
std::vector<std::pair<std::string, bool>> framework_search_paths;
21742176
TargetSP target_sp = typeref_typesystem.GetTargetWP().lock();
@@ -4633,7 +4635,7 @@ void SwiftASTContextForExpressions::ModulesDidLoad(ModuleList &module_list) {
46334635
bool use_all_compiler_flags = target_sp->GetUseAllCompilerFlags();
46344636
unsigned num_images = module_list.GetSize();
46354637
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;
46374639
std::vector<std::string> module_search_paths;
46384640
std::vector<std::pair<std::string, bool>> framework_search_paths;
46394641
std::vector<std::string> extra_clang_args;

0 commit comments

Comments
 (0)