Skip to content

Commit 370cbca

Browse files
authored
IRGen: repair a small regression on Windows (#78689)
Correct the IRGen for the standard library. The thinko here assumed that the else case would be evaluated for the standard library build. We ended up incorrectly handling the well-known VWTs from the runtime when building the standard library.
1 parent f753db2 commit 370cbca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,8 @@ IRGenModule::createStringConstant(StringRef Str, bool willBeRelativelyAddressed,
12971297
if (NAME) \
12981298
return NAME; \
12991299
NAME = Module.getOrInsertGlobal(SYM, FullExistentialTypeMetadataStructTy); \
1300-
if (!getSwiftModule()->isStdlibModule() || \
1301-
!getSwiftModule()->isStaticLibrary()) \
1300+
if (!getSwiftModule()->isStdlibModule() && \
1301+
!Context.getStdlibModule(true)->isStaticLibrary()) \
13021302
ApplyIRLinkage(IRLinkage::ExternalImport) \
13031303
.to(cast<llvm::GlobalVariable>(NAME)); \
13041304
return NAME; \

test/IRGen/isolated_any_metadata.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift -emit-ir %s -target x86_64-apple-macosx10.10 -disable-legacy-type-info -parse-stdlib | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-ACCESSOR
2-
// RUN: %swift -emit-ir %s -target x86_64-unknown-linux-gnu -disable-legacy-type-info -parse-stdlib | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-DEMANGLE
1+
// RUN: %swift -emit-ir %s -target x86_64-apple-macosx10.10 -disable-legacy-type-info -parse-stdlib -module-name Swift | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-ACCESSOR
2+
// RUN: %swift -emit-ir %s -target x86_64-unknown-linux-gnu -disable-legacy-type-info -parse-stdlib -module-name Swift | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-DEMANGLE
33

44
// REQUIRES: concurrency
55

0 commit comments

Comments
 (0)