Skip to content

Commit 592bec5

Browse files
committed
IRGen: Respect -read-legacy-type-info-path flag even if the platform does not use legacy type info by default
1 parent 0e91b49 commit 592bec5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/IRGen/GenType.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,16 +1158,19 @@ TypeConverter::TypeConverter(IRGenModule &IGM)
11581158
if (IGM.IRGen.Opts.DisableLegacyTypeInfo)
11591159
return;
11601160

1161-
auto platformName = getPlatformNameForTriple(IGM.Triple);
1162-
auto archName = getMajorArchitectureName(IGM.Triple);
1163-
1164-
if (!doesPlatformUseLegacyLayouts(platformName, archName))
1165-
return;
1166-
11671161
llvm::SmallString<128> defaultPath;
11681162

11691163
StringRef path = IGM.IRGen.Opts.ReadLegacyTypeInfoPath;
11701164
if (path.empty()) {
1165+
// If the flag was not explicitly specified, look for a file in a
1166+
// platform-specific location, if this platform is known to require
1167+
// one.
1168+
auto platformName = getPlatformNameForTriple(IGM.Triple);
1169+
auto archName = getMajorArchitectureName(IGM.Triple);
1170+
1171+
if (!doesPlatformUseLegacyLayouts(platformName, archName))
1172+
return;
1173+
11711174
defaultPath.append(IGM.Context.SearchPathOpts.RuntimeLibraryPath);
11721175
llvm::sys::path::append(defaultPath, "layouts-");
11731176
defaultPath.append(archName);

0 commit comments

Comments
 (0)