Fix several incorrect uses of ApplySite::getArgumentConvention.

At least most of these were latent bugs since the code was
unreachable in the PartialApply case. But that's no excuse to misuse
the API.

Also, whenever referring to an integer index, be explicit about
whether it is an applied argument or callee argument.
This commit is contained in:
Andrew Trick
2018-07-20 14:25:53 -07:00
parent 401be14483
commit 89ed064808
7 changed files with 19 additions and 39 deletions

View File

@@ -2713,7 +2713,7 @@ public:
auto isConsumingOrMutatingApplyUse = [](Operand *use) -> bool {
ApplySite apply(use->getUser());
assert(apply && "Not an apply instruction kind");
auto conv = apply.getArgumentConvention(use->getOperandNumber() - 1);
auto conv = apply.getArgumentConvention(*use);
switch (conv) {
case SILArgumentConvention::Indirect_In_Guaranteed:
return false;