Skip to content

Commit 5080628

Browse files
authored
Merge pull request #74814 from finagolfin/map
[ClangImporter] Make sure the `-resource-dir` is checked before the `-sdk`, as done everywhere else in the compiler
2 parents cccacd7 + b7ec9c8 commit 5080628

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/ClangImporter/ClangIncludePaths.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ static std::optional<Path> getActualModuleMapPath(
3535

3636
Path result;
3737

38-
StringRef SDKPath = Opts.getSDKPath();
39-
if (!SDKPath.empty()) {
40-
result.append(SDKPath.begin(), SDKPath.end());
41-
llvm::sys::path::append(result, "usr", "lib", "swift");
38+
if (!Opts.RuntimeResourcePath.empty()) {
39+
result.append(Opts.RuntimeResourcePath.begin(),
40+
Opts.RuntimeResourcePath.end());
4241
llvm::sys::path::append(result, platform);
4342
if (isArchSpecific) {
4443
llvm::sys::path::append(result, arch);
@@ -52,10 +51,11 @@ static std::optional<Path> getActualModuleMapPath(
5251
return result;
5352
}
5453

55-
if (!Opts.RuntimeResourcePath.empty()) {
54+
StringRef SDKPath = Opts.getSDKPath();
55+
if (!SDKPath.empty()) {
5656
result.clear();
57-
result.append(Opts.RuntimeResourcePath.begin(),
58-
Opts.RuntimeResourcePath.end());
57+
result.append(SDKPath.begin(), SDKPath.end());
58+
llvm::sys::path::append(result, "usr", "lib", "swift");
5959
llvm::sys::path::append(result, platform);
6060
if (isArchSpecific) {
6161
llvm::sys::path::append(result, arch);

0 commit comments

Comments
 (0)