Skip to content

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Sep 3, 2025

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.

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.
@DougGregor
Copy link
Member Author

@swift-ci please test

This ensures that one can use deferred code generation everywhere with
Embedded Swift and still get the appropriate entry symbol emitted.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit ba2af97 into swiftlang:main Sep 4, 2025
5 checks passed
@DougGregor DougGregor deleted the embedded-deferred-codegen branch September 4, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant