mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[+0 self][pin removal] Teach pinremoval how to use RCIdentityAnalysis when removing pins.
Previously, we were being very conservative and were not trying to look through any RCId uses. Now we understand how to look through RCIdentical instructions to pair a pin and unpin. We also understand how to use the new getRCUses API on RCIdentityAnalysis to get all uses of a value, looking through RCIdentical instructions. I also added some code to COWArrayOpts to teach it how to look through enum insts (which I needed). Additionally I got stuck and added support for automatic indentation in Debug statements. This is better than having to indent by hand every time. There were no significant perf changes since this code was not being emitted by the frontend. But without this +0 self causes COW to break. rdar://20267677 Swift SVN r26529
This commit is contained in:
@@ -559,7 +559,13 @@ public:
|
||||
EnumElementDecl *Element, SILType Ty) {
|
||||
return insert(new (F.getModule()) EnumInst(Loc, Operand, Element, Ty));
|
||||
}
|
||||
|
||||
|
||||
/// Create an enum Optional<T>.Some.
|
||||
EnumInst *createOptionalSome(SILLocation Loc, SILValue Operand, SILType Ty) {
|
||||
auto *Decl = F.getModule().getASTContext().getOptionalSomeDecl();
|
||||
return createEnum(Loc, Operand, Decl, Ty);
|
||||
}
|
||||
|
||||
InitEnumDataAddrInst *createInitEnumDataAddr(SILLocation Loc, SILValue Operand,
|
||||
EnumElementDecl *Element, SILType Ty) {
|
||||
return insert(
|
||||
|
||||
Reference in New Issue
Block a user