From 0b884c8e6a70a57740f58c740f551056f762c6eb Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 16 Jul 2020 15:50:13 -0400 Subject: [PATCH] IRGen: Simplify logic for locating the legacy type info YAML file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- lib/IRGen/GenType.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/IRGen/GenType.cpp b/lib/IRGen/GenType.cpp index 7c8423d1f357b..1d99e48ca3f42 100644 --- a/lib/IRGen/GenType.cpp +++ b/lib/IRGen/GenType.cpp @@ -1355,23 +1355,7 @@ TypeConverter::TypeConverter(IRGenModule &IGM) if (!doesPlatformUseLegacyLayouts(platformName, archName)) return; - // Find the first runtime library path that exists. - bool found = false; - for (auto &RuntimeLibraryPath - : IGM.Context.SearchPathOpts.RuntimeLibraryPaths) { - if (fs->exists(RuntimeLibraryPath)) { - defaultPath.append(RuntimeLibraryPath); - found = true; - break; - } - } - if (!found) { - auto joined = llvm::join(IGM.Context.SearchPathOpts.RuntimeLibraryPaths, - "', '"); - llvm::report_fatal_error("Unable to find a runtime library path at '" - + joined + "'"); - } - + defaultPath = IGM.Context.SearchPathOpts.RuntimeLibraryPaths[0]; llvm::sys::path::append(defaultPath, "layouts-"); defaultPath.append(archName); defaultPath.append(".yaml");