[Macros] Plugin search options group

'load-plugin-library', 'load-plugin-executable', '-plugin-path' and
'-external-plugin-path' should be searched in the order they are
specified in the arguments.

Previously, for example '-plugin-path' used to precede
'-external-plugin-path' regardless of the position in the arguments.
This commit is contained in:
Rintaro Ishizaki
2023-06-14 15:17:19 -07:00
parent 71432032d4
commit 5791a2cb37
16 changed files with 221 additions and 277 deletions

View File

@@ -205,8 +205,7 @@ void SerializedModuleLoaderBase::collectVisibleTopLevelModuleNamesImpl(
});
return None;
}
case ModuleSearchPathKind::RuntimeLibrary:
case ModuleSearchPathKind::CompilerPlugin: {
case ModuleSearchPathKind::RuntimeLibrary: {
// Look for:
// (Darwin OS) $PATH/{name}.swiftmodule/{arch}.{extension}
// (Other OS) $PATH/{name}.{extension}
@@ -678,8 +677,7 @@ bool SerializedModuleLoaderBase::findModule(
switch (searchPath->getKind()) {
case ModuleSearchPathKind::Import:
case ModuleSearchPathKind::RuntimeLibrary:
case ModuleSearchPathKind::CompilerPlugin: {
case ModuleSearchPathKind::RuntimeLibrary: {
isFramework = false;
// On Apple platforms, we can assume that the runtime libraries use