Skip to content

Commit 0b884c8

Browse files
committed
IRGen: Simplify logic for locating the legacy type info YAML file
This will eliminate the unhelpful "Cannot read ‘/usr/lib/swift/layouts-x86_64.yaml’" error message, and actually print the location where the file was supposed to be found.
1 parent 5141219 commit 0b884c8

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

lib/IRGen/GenType.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,23 +1355,7 @@ TypeConverter::TypeConverter(IRGenModule &IGM)
13551355
if (!doesPlatformUseLegacyLayouts(platformName, archName))
13561356
return;
13571357

1358-
// Find the first runtime library path that exists.
1359-
bool found = false;
1360-
for (auto &RuntimeLibraryPath
1361-
: IGM.Context.SearchPathOpts.RuntimeLibraryPaths) {
1362-
if (fs->exists(RuntimeLibraryPath)) {
1363-
defaultPath.append(RuntimeLibraryPath);
1364-
found = true;
1365-
break;
1366-
}
1367-
}
1368-
if (!found) {
1369-
auto joined = llvm::join(IGM.Context.SearchPathOpts.RuntimeLibraryPaths,
1370-
"', '");
1371-
llvm::report_fatal_error("Unable to find a runtime library path at '"
1372-
+ joined + "'");
1373-
}
1374-
1358+
defaultPath = IGM.Context.SearchPathOpts.RuntimeLibraryPaths[0];
13751359
llvm::sys::path::append(defaultPath, "layouts-");
13761360
defaultPath.append(archName);
13771361
defaultPath.append(".yaml");

0 commit comments

Comments
 (0)