Commit Graph

12 Commits

Author SHA1 Message Date
Erik Eckstein
6226d56a52 SmallProjectionPath: add mayHaveTwoClassProjections 2023-02-11 08:55:20 +01:00
Erik Eckstein
8daa54a8c5 SmallProjectionPath: replace hasNoClassProjection with mayHaveClassProjection
It's less confusing.
NFC
2023-02-11 08:55:20 +01:00
Erik Eckstein
aea26bbc6e Swift SIL: add a utility protocol NoReflectionChildren for better debug output with lldb po
Let's lldb's `po` command not print any "internal" properties of the conforming type.
This is useful if the `description` already contains all the information of a type instance.
2022-10-05 07:37:41 +02:00
Erik Eckstein
4554939dc4 SwiftCompilerSources: consistently use assert instead of precondition
It's better to use the new assert implementation (defined in the "Basic" module) than Swift's `precondition`
2022-09-14 14:16:26 +02:00
Erik Eckstein
e1ff0aa235 SmallProjectionPath: allow parsing an empty path
If the string to parse doesn't start with a token which belongs to a projection path, just return an empty path instead of throwing an error.
2022-09-12 09:14:54 +02:00
Erik Eckstein
3367fdd04d SmallProjectionPath: add mayOverlap(with:)
"Overlapping" means that both paths may project the same field.
2022-08-22 13:22:06 +02:00
Erik Eckstein
b52297bb79 Swift SIL: some improvements for WalkUtils and EscapeInfo
* "merge" the `Path` and `State` in WalkUtils into a single `WalkingPath`. This makes it simpler for clients to configure a path and additional state variables. EscapeInfo now defines `EscapePath` which includes the projection path and EscapeInfo's specific state variables.
* Make the `WalkerCache` part of the WalkUtils, so that not all clients have to re-implement it.
* Rename `walkDownResults` -> `walkDownAllResults` and `walkUpOperands` -> `walkUpAllOperands` and make these functions client configurable.
2022-07-20 13:50:18 +02:00
Anxhelo Xhebraj
c3ccbde52b Swift Optimizer: update EscapeInfo to use the generic walker utilities
`EscapeInfo` now conforms to the generic protocols defined in `WalkUtils`.
This simplifies the implementation a bit, since trivial instructions are handled
by `WalkUtils` and `EscapeInfo` only has to handle a subset of instructions
inherent to escape information.
Passes using `EscapeInfo` are updated accordingly to become visitors that
customize the `EscapeInfo` walk.
2022-07-05 11:28:49 -07:00
Erik Eckstein
b75108e70a Swift SIL: a few small addition to SmallProjectionPath
* rename `matchesAllValueFields` -> `topMatchesAnyValueField`
* add `hasSingleClassIndirection` and `hasClassProjection`
* add `popLastClassAndValuesFromTail`
2022-04-22 09:50:07 +02:00
Saleem Abdulrasool
218ef587e6 Revert "Merge pull request #42242 from eeckstein/escapeinfo"
This reverts commit c05e064cd8, reversing
changes made to c1534d5af9.

This caused a regression on Windows.
2022-04-21 20:33:37 -07:00
Erik Eckstein
003fdec7fb Swift SIL: a few small addition to SmallProjectionPath
* rename `matchesAllValueFields` -> `topMatchesAnyValueField`
* add `hasSingleClassIndirection` and `hasClassProjection`
* add `popLastClassAndValuesFromTail`
2022-04-21 08:45:08 +02:00
Erik Eckstein
fb00bc3b44 Swift SIL: add the SmallProjectionPath utility
The `SmallProjectionPath` represents a path of value or address projections.
It’s used for defining argument effects for functions and for the new escape analysis.
2022-01-25 11:29:25 +01:00