Skip to content

Commit 53280d7

Browse files
authored
Merge pull request swiftlang#78509 from meg-gupta/fixrecompile
Allow recompilation of modules in the resource directory when importing non-ossa module to ossa module
2 parents 8ec8a12 + 4533695 commit 53280d7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,17 @@ class ModuleInterfaceLoaderImpl {
936936
} else if (isInResourceDir(adjacentMod) &&
937937
loadMode == ModuleLoadingMode::PreferSerialized &&
938938
!version::isCurrentCompilerTagged() &&
939-
rebuildInfo.getOrInsertCandidateModule(adjacentMod).serializationStatus !=
940-
serialization::Status::SDKMismatch) {
939+
rebuildInfo.getOrInsertCandidateModule(adjacentMod)
940+
.serializationStatus !=
941+
serialization::Status::SDKMismatch &&
942+
// FIXME (meg-gupta): We need to support recompilation of
943+
// modules in the resource directory if the mismatch is due
944+
// to importing a non-ossa module to an ossa module. This is
945+
// needed during ossa bringup, once -enable-ossa-modules is
946+
// on by default, this can be deleted.
947+
rebuildInfo.getOrInsertCandidateModule(adjacentMod)
948+
.serializationStatus !=
949+
serialization::Status::NotInOSSA) {
941950
// Special-case here: If we're loading a .swiftmodule from the resource
942951
// dir adjacent to the compiler, defer to the serialized loader instead
943952
// of falling back. This is to support local development of Swift,

test/SILOptimizer/stdlib/Atomics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -O -Xllvm -sil-print-types -emit-sil -disable-availability-checking %s | %IRGenFileCheck %s
1+
// RUN: %target-swift-frontend -O -Xllvm -sil-print-types -emit-sil -disable-availability-checking -enable-ossa-modules %s | %IRGenFileCheck %s
22

33
// REQUIRES: synchronization
44

0 commit comments

Comments
 (0)