Skip to content

Commit e123815

Browse files
committed
IRGen: Use the correct triple when checking for YAML legacy type info
IGM.Triple is irgen.getEffectiveClangTriple(), which says "thumbv7" in place of "armv7" for 32-bit iOS ARM targets. Instead, lets use IGM.Context.LangOpts.Target, which is what we use to find swiftmodule files.
1 parent 592bec5 commit e123815

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

lib/IRGen/GenType.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,8 @@ TypeConverter::TypeConverter(IRGenModule &IGM)
11511151
if (IGM.IRGen.Opts.EnableResilienceBypass)
11521152
LoweringMode = Mode::CompletelyFragile;
11531153

1154+
const auto &Triple = IGM.Context.LangOpts.Target;
1155+
11541156
// We have a bunch of -parse-stdlib tests that pass a -target in the test
11551157
// suite. To prevent these from failing when the user hasn't build the
11561158
// standard library for that target, we pass -disable-legacy-type-info to
@@ -1165,8 +1167,8 @@ TypeConverter::TypeConverter(IRGenModule &IGM)
11651167
// If the flag was not explicitly specified, look for a file in a
11661168
// platform-specific location, if this platform is known to require
11671169
// one.
1168-
auto platformName = getPlatformNameForTriple(IGM.Triple);
1169-
auto archName = getMajorArchitectureName(IGM.Triple);
1170+
auto platformName = getPlatformNameForTriple(Triple);
1171+
auto archName = swift::getMajorArchitectureName(Triple);
11701172

11711173
if (!doesPlatformUseLegacyLayouts(platformName, archName))
11721174
return;

test/IRGen/arm_to_thumb_darwin.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift -target armv7-apple-ios7 %s -gnone -emit-ir -o - | %FileCheck %s -check-prefix=IOS
2-
// RUN: %swift -target armv7k-apple-watchos2 %s -gnone -emit-ir -o - | %FileCheck %s -check-prefix=WATCHOS
1+
// RUN: %swift -target armv7-apple-ios7 -disable-legacy-type-info %s -gnone -emit-ir -o - | %FileCheck %s -check-prefix=IOS
2+
// RUN: %swift -target armv7k-apple-watchos2 -disable-legacy-type-info %s -gnone -emit-ir -o - | %FileCheck %s -check-prefix=WATCHOS
33

44
// REQUIRES: CODEGENERATOR=ARM
55

test/IRGen/autorelease_optimized_armv7.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift -gnone -O -target armv7-apple-ios7 -emit-assembly %s -o - | %FileCheck %s
1+
// RUN: %swift -gnone -O -target armv7-apple-ios7 -disable-legacy-type-info -emit-assembly %s -o - | %FileCheck %s
22

33
// REQUIRES: CODEGENERATOR=ARM
44

test/IRGen/bridge_object_armv7.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift -module-name bridge_object -emit-ir -target armv7-apple-ios8.0 %s | %FileCheck %s
1+
// RUN: %swift -module-name bridge_object -emit-ir -target armv7-apple-ios8.0 -disable-legacy-type-info %s | %FileCheck %s
22

33
// REQUIRES: CODEGENERATOR=ARM
44

test/IRGen/integer_literal.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift -target armv7-apple-ios10 -module-name integer_literal %s -gnone -emit-ir | %FileCheck %s
1+
// RUN: %swift -target armv7-apple-ios10 -disable-legacy-type-info -module-name integer_literal %s -gnone -emit-ir | %FileCheck %s
22

33
// REQUIRES: CODEGENERATOR=ARM
44

test/IRGen/ordering_arm.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %swift -target armv7-apple-ios7.1 %s -module-name main -emit-ir -o - | %FileCheck %s
1+
// RUN: %swift -target armv7-apple-ios7.1 -disable-legacy-type-info %s -module-name main -emit-ir -o - | %FileCheck %s
22

33
// REQUIRES: CODEGENERATOR=ARM
44

0 commit comments

Comments
 (0)