Commit Graph

6 Commits

Author SHA1 Message Date
Allan Shortlidge
185022cbb5 SILGen: Only skip decls nested in functions when the function is skipped.
If a function body is emitted, all of the declarations inside that function
body must be emitted, too. Previously, lazy var initializers were being skipped
regardless of whether the function containing them was skipped, resulting in
SIL verification errors (which were correctly predicting linker errors).

Resolves rdar://134708502.
2024-08-27 14:29:08 -07:00
Allan Shortlidge
67661ccf93 Frontend: Ignore lazy typechecking flags when emitting non-resilient modules.
The `-experimental-lazy-typecheck` and `-experimental-skip-non-exportable-decls`
flags are not safe to use when emitting a non-resilient module because the
clients of non-resilient modules expect to have access to all the members of a
type in order to e.g. compute the size the type. The
`-experimental-skip-non-exportable-decls` flag skips serialization of
non-public members and would therefore cause mis-compilation. The
`-experimental-lazy-typecheck` is theoretically safe for non-resilient modules
but more requestification work is needed before it can be used successfully.

Resolves rdar://122272758
2024-02-04 09:10:46 -08:00
Allan Shortlidge
5b95737a69 SILGen: Skip emitting non-exportable property wrapper backing inits.
When `-experimental-skip-non-exportable-decls` is specified, skip emitting
property wrapper backing inits since they cannot be referenced directly by
module clients.

Resolves rdar://119469651
2023-12-10 16:33:34 -08:00
Allan Shortlidge
a038f7d8c6 AST: Handle PoundDiagnosticDecl in DeclExportabilityVisitor. 2023-12-10 09:10:05 -08:00
Allan Shortlidge
13a1861a1f SILGen: Don't skip functions nested in closures in inlinable functions.
The logic for walking up the tree of DeclContexts did not handle closures
correctly.

Resolves rdar://119350220
2023-12-07 18:24:37 -08:00
Allan Shortlidge
29fec064c2 NFC: Rename SILGen skip function bodies tests to match convention.
Consolidate a couple tests into skip_function_bodies_storage.swift.
2023-11-16 16:57:24 -08:00