|
38 | 38 | #include "swift/Option/Options.h"
|
39 | 39 | #include "swift/Parse/ParseVersion.h"
|
40 | 40 | #include "llvm/ADT/IntrusiveRefCntPtr.h"
|
| 41 | +#include "llvm/ADT/STLExtras.h" |
41 | 42 | #include "llvm/Support/VirtualOutputBackends.h"
|
42 | 43 | #include "llvm/Support/raw_ostream.h"
|
43 | 44 | #include <functional>
|
@@ -2261,11 +2262,12 @@ class SwiftAPIDigesterInvocation {
|
2261 | 2262 | std::string BaselineSDK;
|
2262 | 2263 | std::string Triple;
|
2263 | 2264 | std::string SwiftVersion;
|
2264 |
| - std::vector<std::string> CCSystemFrameworkPaths; |
| 2265 | + std::vector<std::string> SystemFrameworkPaths; |
2265 | 2266 | std::vector<std::string> BaselineFrameworkPaths;
|
2266 | 2267 | std::vector<std::string> FrameworkPaths;
|
2267 |
| - std::vector<std::string> BaselineModuleInputPaths; |
2268 |
| - std::vector<std::string> ModuleInputPaths; |
| 2268 | + std::vector<std::string> SystemModuleImportPaths; |
| 2269 | + std::vector<std::string> BaselineModuleImportPaths; |
| 2270 | + std::vector<std::string> ModuleImportPaths; |
2269 | 2271 | std::string ModuleList;
|
2270 | 2272 | std::vector<std::string> ModuleNames;
|
2271 | 2273 | std::vector<std::string> PreferInterfaceForModules;
|
@@ -2362,11 +2364,13 @@ class SwiftAPIDigesterInvocation {
|
2362 | 2364 | BaselineSDK = ParsedArgs.getLastArgValue(OPT_bsdk).str();
|
2363 | 2365 | Triple = ParsedArgs.getLastArgValue(OPT_target).str();
|
2364 | 2366 | SwiftVersion = ParsedArgs.getLastArgValue(OPT_swift_version).str();
|
2365 |
| - CCSystemFrameworkPaths = ParsedArgs.getAllArgValues(OPT_iframework); |
| 2367 | + SystemFrameworkPaths = ParsedArgs.getAllArgValues(OPT_Fsystem); |
| 2368 | + llvm::append_range(SystemFrameworkPaths, ParsedArgs.getAllArgValues(OPT_iframework)); |
2366 | 2369 | BaselineFrameworkPaths = ParsedArgs.getAllArgValues(OPT_BF);
|
2367 | 2370 | FrameworkPaths = ParsedArgs.getAllArgValues(OPT_F);
|
2368 |
| - BaselineModuleInputPaths = ParsedArgs.getAllArgValues(OPT_BI); |
2369 |
| - ModuleInputPaths = ParsedArgs.getAllArgValues(OPT_I); |
| 2371 | + SystemModuleImportPaths = ParsedArgs.getAllArgValues(OPT_Isystem); |
| 2372 | + BaselineModuleImportPaths = ParsedArgs.getAllArgValues(OPT_BI); |
| 2373 | + ModuleImportPaths = ParsedArgs.getAllArgValues(OPT_I); |
2370 | 2374 | ModuleList = ParsedArgs.getLastArgValue(OPT_module_list_file).str();
|
2371 | 2375 | ModuleNames = ParsedArgs.getAllArgValues(OPT_module);
|
2372 | 2376 | PreferInterfaceForModules =
|
@@ -2421,7 +2425,7 @@ class SwiftAPIDigesterInvocation {
|
2421 | 2425 | }
|
2422 | 2426 |
|
2423 | 2427 | bool hasBaselineInput() {
|
2424 |
| - return !BaselineModuleInputPaths.empty() || |
| 2428 | + return !BaselineModuleImportPaths.empty() || |
2425 | 2429 | !BaselineFrameworkPaths.empty() || !BaselineSDK.empty();
|
2426 | 2430 | }
|
2427 | 2431 |
|
@@ -2476,29 +2480,30 @@ class SwiftAPIDigesterInvocation {
|
2476 | 2480 | InitInvoke.setRuntimeResourcePath(ResourceDir);
|
2477 | 2481 | }
|
2478 | 2482 | std::vector<SearchPathOptions::SearchPath> FramePaths;
|
2479 |
| - for (const auto &path : CCSystemFrameworkPaths) { |
| 2483 | + for (const auto &path : SystemFrameworkPaths) { |
2480 | 2484 | FramePaths.push_back({path, /*isSystem=*/true});
|
2481 | 2485 | }
|
| 2486 | + std::vector<SearchPathOptions::SearchPath> ImportPaths; |
| 2487 | + for (const auto &path : SystemModuleImportPaths) { |
| 2488 | + ImportPaths.push_back({path, /*isSystem=*/true}); |
| 2489 | + } |
2482 | 2490 | if (IsBaseline) {
|
2483 | 2491 | for (const auto &path : BaselineFrameworkPaths) {
|
2484 | 2492 | FramePaths.push_back({path, /*isSystem=*/false});
|
2485 | 2493 | }
|
2486 |
| - std::vector<SearchPathOptions::SearchPath> ImportPaths; |
2487 |
| - for (const auto &path : BaselineModuleInputPaths) { |
| 2494 | + for (const auto &path : BaselineModuleImportPaths) { |
2488 | 2495 | ImportPaths.push_back({path, /*isSystem=*/false});
|
2489 | 2496 | }
|
2490 |
| - InitInvoke.setImportSearchPaths(ImportPaths); |
2491 | 2497 | } else {
|
2492 | 2498 | for (const auto &path : FrameworkPaths) {
|
2493 | 2499 | FramePaths.push_back({path, /*isSystem=*/false});
|
2494 | 2500 | }
|
2495 |
| - std::vector<SearchPathOptions::SearchPath> ImportPaths; |
2496 |
| - for (const auto &path : ModuleInputPaths) { |
| 2501 | + for (const auto &path : ModuleImportPaths) { |
2497 | 2502 | ImportPaths.push_back({path, /*isSystem=*/false});
|
2498 | 2503 | }
|
2499 |
| - InitInvoke.setImportSearchPaths(ImportPaths); |
2500 | 2504 | }
|
2501 | 2505 | InitInvoke.setFrameworkSearchPaths(FramePaths);
|
| 2506 | + InitInvoke.setImportSearchPaths(ImportPaths); |
2502 | 2507 | if (!ModuleList.empty()) {
|
2503 | 2508 | if (readFileLineByLine(ModuleList, Modules))
|
2504 | 2509 | exit(1);
|
|
0 commit comments