mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AccessUtils: support computing "constant" access paths
Add `Value.constantAccessPath`. It is like `accessPath`, but ensures that the projectionPath only contains "constant" elements. This means: if the access contains an `index_addr` projection with a non-constant index, the `projectionPath` does _not_ contain the `index_addr`. Instead, the `base` is an `AccessBase.index` which refers to the `index_addr`.
This commit is contained in:
@@ -467,7 +467,7 @@ private extension AccessBase {
|
||||
return .decidedInCaller(arg)
|
||||
case .yield, .pointer:
|
||||
return .unknown
|
||||
case .unidentified:
|
||||
case .index, .unidentified:
|
||||
// In the rare case of an unidentified access, just ignore it.
|
||||
// This should not happen in regular SIL, anyway.
|
||||
return .no
|
||||
|
||||
Reference in New Issue
Block a user