Andrew Trick
3bee32639b
LifetimeDependenceDefUseWalker: use LocalVariableReachableUses.
2024-03-05 18:08:16 -08:00
Andrew Trick
a3fe978cc4
LifetimeDependenceUtils: handle borrowed ProjectBox
2024-03-05 17:08:13 -08:00
Andrew Trick
ef940c5297
Redesign gatherBorrowIntroducers to return BeginBorrowValues.
...
This avoids a lot of confusion because the callers expect this type. Fixing it just required some redundancy and
bridging in the EnclosigValues implementation.
2024-03-05 17:08:13 -08:00
Erik Eckstein
8137adf89e
SwiftCompilerSources: support Undef.parentFunction and PlaceholderValue.parentFunction
...
After support in the C++ SIL, we can implement parentFunction for those values in swift, too.
It simplifies a few things.
2024-03-01 09:07:12 +01:00
Andrew Trick
a7e4e900c4
Fix LifetimeDependenceUtils to use OwnershipTransitionInstruction
2024-02-26 00:20:46 -08:00
Meghana Gupta
12ac8042ab
Handle YieldInst in LifetimeDependenceUtils
2024-02-19 15:28:04 -08:00
Andrew Trick
41043948c1
LifetimeDependenceDiagnostics: enable mutably borrowed lifetimes.
...
This allows basic prototyping. A separate analysis will ensure no
mutation of the original value during the borrow.
2024-02-15 02:39:34 -08:00
Andrew Trick
68037faa61
LifetimeDependenceScopeFixup: handle nested access
...
After extending access scopes, rewrite the mark_depenendence to be on
the outermost scope.
2024-02-13 22:22:28 -08:00
Andrew Trick
f0b04004ff
LifetimeDepenenceUtils; improve VariableIntroducerUseDefWalker
...
Stop at formal access to a mutable variable.
2024-02-13 20:57:02 -08:00
Andrew Trick
1cdf9d56ac
LifetimeDefUseWalker handles inherited dependencies.
...
This is needed when we don't insert mark_dependence.
2024-02-12 20:05:24 -08:00
Andrew Trick
2e7c29cdf5
Restrict findSingleInitializer @out arguments.
...
The client should handle @in/@inout arguments differently.
2024-02-12 20:03:38 -08:00
Andrew Trick
af39b0fb1f
LifetimeDependenceUtils improvements
...
Improve noescape function handling. Use the mayEscape API.
Improve handling of @_unsafeNonescapableResult.
Improve handling of initialized scopes. Use findSingleInitializer.
2024-02-12 09:57:14 -08:00
Andrew Trick
ac457abab9
LifetimeDependenceUseDefWalker: track the owner of the value.
2024-02-12 09:57:14 -08:00
Andrew Trick
63413916a1
LifetimeDependenceDiagnostics; handle @_unsafeNonescapableResult.
2024-02-12 09:57:14 -08:00
Andrew Trick
8b24382494
SwiftCompilerSources: cleanup and extend ArgumentConventions
...
Provide APIs needed by lifetime dependence diagnostics, namely LifetimeDependenceConvention.
Reorganize the APIs so it's easy to find related functionality which
API is responsible for which functionality.
Remove the originalFunctionConvention complexity. It is no longer
needed for lifetime dependence inference, and generally should be
avoided in SIL.
Add some placeholder FIXMEs because this not a good PR in which to
change existing functionality.
2024-02-12 09:57:14 -08:00
Andrew Trick
ddceffaf3b
LifetimeDependenceDiagnostics pass
...
Initial diagnostic pass to enforce ~Escapable types.
2024-01-30 11:45:55 -08:00
Andrew Trick
25cff623ab
Improve LifetimeDependenceUtils
2024-01-30 08:38:57 -08:00
Andrew Trick
2ef870a52b
Add LifetimeDependence utilities
2024-01-22 23:57:03 -08:00