mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[opt-remark] Add support for simple object projections.
This ensures that we are able to properly look through struct_extract,
tuple_extract in cases where we have an aggregate with multiple non-trivial
subtypes (implying it is not-rc identical with those sub-types).
The end result is that we now emit good diagnostics for things like this:
```
func returnStructWithOwnerOwner(x: StructWithOwner) -> Klass {
return x.owner // expected-remark {{retain}}
// expected-note @-7:33 {{of 'x.owner'}}
}
```
This commit is contained in:
@@ -247,7 +247,8 @@ public:
|
||||
|
||||
Projection &operator=(Projection &&P) = default;
|
||||
|
||||
bool isValid() const { return Value.isValid(); }
|
||||
bool isValid() const { return bool(*this); }
|
||||
operator bool() const { return Value.isValid(); }
|
||||
|
||||
/// Convenience method for getting the underlying index. Assumes that this
|
||||
/// projection is valid. Otherwise it asserts.
|
||||
|
||||
Reference in New Issue
Block a user