mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Embedded] Introduce DeferredCodeGen feature.
Introduce an experimental feature DeferredCodeGen, that defers the generation of LLVM IR (and therefore object code) for all entities within an Embedded Swift module unless they have explicitly requested to not be emitted into the client (e.g., with `@_neverEmitIntoClient`). This feature is meant to generalize and subsume -emit-empty-object-file, relying on lazy emission of entities rather than abruptly ending the compilation pipeline before emitting any IR. Part of rdar://158363967.
This commit is contained in:
@@ -421,8 +421,11 @@ private:
|
||||
/// Whether this module enabled strict memory safety.
|
||||
unsigned StrictMemorySafety : 1;
|
||||
|
||||
/// Whether this module used deferred code generation.
|
||||
unsigned DeferredCodeGen : 1;
|
||||
|
||||
// Explicitly pad out to the next word boundary.
|
||||
unsigned : 2;
|
||||
unsigned : 1;
|
||||
} Bits = {};
|
||||
static_assert(sizeof(ModuleBits) <= 8, "The bit set should be small");
|
||||
|
||||
@@ -696,6 +699,8 @@ public:
|
||||
|
||||
bool strictMemorySafety() const { return Bits.StrictMemorySafety; }
|
||||
|
||||
bool deferredCodeGen() const { return Bits.DeferredCodeGen; }
|
||||
|
||||
/// How should \p dependency be loaded for a transitive import via \c this?
|
||||
///
|
||||
/// If \p importNonPublicDependencies, more transitive dependencies
|
||||
|
||||
Reference in New Issue
Block a user