swift
09ae2ef0 - [ownership] Centralize all info about SILInstruction forwarding in the SILInstruction class hierarchy itself.

Commit
4 years ago
[ownership] Centralize all info about SILInstruction forwarding in the SILInstruction class hierarchy itself. This commit is doing a few things: 1. It is centralizing all decisions about whether an operand's owner instruction or a value's parent instruction is forwarding in each SILInstruction itself. This will prevent this information from getting out of sync. 2. This allowed me to hide the low level queries in OwnershipUtils.h that determined if a SILNodeKind was "forwarding". I tried to minimize the amount of churn in this PR and thus didn't remove the is{Owned,Ownership,Guaranteed}Forwarding{Use,Value} checks. Instead I left them alone but added in asserts to make sure that if the old impl ever returns true, the neew impl does as well. In a subsequent commit, I am going to remove the old impl in favor of isa queries. 3. I also in the process discovered that there were some instructions that were being inconsistently marked as forwarding. All of the asserts in the PR caught these and I fixed these inconsistencies.
Author
Committer
Parents
Loading