@@ -1690,7 +1690,7 @@ static const Expr *lookThroughExprsToImmediateDeallocation(const Expr *E) {
1690
1690
}
1691
1691
}
1692
1692
1693
- static void diagnoseUnownedImmediateDeallocationImpl (TypeChecker &TC ,
1693
+ static void diagnoseUnownedImmediateDeallocationImpl (ASTContext &ctx ,
1694
1694
const VarDecl *varDecl,
1695
1695
const Expr *initExpr,
1696
1696
SourceLoc diagLoc,
@@ -1741,17 +1741,18 @@ static void diagnoseUnownedImmediateDeallocationImpl(TypeChecker &TC,
1741
1741
if (varDecl->getDeclContext ()->isTypeContext ())
1742
1742
storageKind = SK_Property;
1743
1743
1744
- TC.diagnose (diagLoc, diag::unowned_assignment_immediate_deallocation,
1745
- varDecl->getName (), ownershipAttr->get (), unsigned (storageKind))
1744
+ ctx.Diags .diagnose (diagLoc, diag::unowned_assignment_immediate_deallocation,
1745
+ varDecl->getName (), ownershipAttr->get (),
1746
+ unsigned (storageKind))
1746
1747
.highlight (diagRange);
1747
1748
1748
- TC .diagnose (diagLoc, diag::unowned_assignment_requires_strong)
1749
+ ctx. Diags .diagnose (diagLoc, diag::unowned_assignment_requires_strong)
1749
1750
.highlight (diagRange);
1750
1751
1751
- TC .diagnose (varDecl, diag::decl_declared_here, varDecl->getFullName ());
1752
+ ctx. Diags .diagnose (varDecl, diag::decl_declared_here, varDecl->getFullName ());
1752
1753
}
1753
1754
1754
- void swift::diagnoseUnownedImmediateDeallocation (TypeChecker &TC ,
1755
+ void swift::diagnoseUnownedImmediateDeallocation (ASTContext &ctx ,
1755
1756
const AssignExpr *assignExpr) {
1756
1757
auto *destExpr = assignExpr->getDest ()->getValueProvidingExpr ();
1757
1758
auto *initExpr = assignExpr->getSrc ();
@@ -1765,12 +1766,12 @@ void swift::diagnoseUnownedImmediateDeallocation(TypeChecker &TC,
1765
1766
}
1766
1767
1767
1768
if (VD)
1768
- diagnoseUnownedImmediateDeallocationImpl (TC , VD, initExpr,
1769
+ diagnoseUnownedImmediateDeallocationImpl (ctx , VD, initExpr,
1769
1770
assignExpr->getLoc (),
1770
1771
initExpr->getSourceRange ());
1771
1772
}
1772
1773
1773
- void swift::diagnoseUnownedImmediateDeallocation (TypeChecker &TC ,
1774
+ void swift::diagnoseUnownedImmediateDeallocation (ASTContext &ctx ,
1774
1775
const Pattern *pattern,
1775
1776
SourceLoc equalLoc,
1776
1777
const Expr *initExpr) {
@@ -1788,12 +1789,12 @@ void swift::diagnoseUnownedImmediateDeallocation(TypeChecker &TC,
1788
1789
const Pattern *subPattern = elt.getPattern ();
1789
1790
Expr *subInitExpr = TE->getElement (i);
1790
1791
1791
- diagnoseUnownedImmediateDeallocation (TC , subPattern, equalLoc,
1792
+ diagnoseUnownedImmediateDeallocation (ctx , subPattern, equalLoc,
1792
1793
subInitExpr);
1793
1794
}
1794
1795
}
1795
1796
} else if (auto *NP = dyn_cast<NamedPattern>(pattern)) {
1796
- diagnoseUnownedImmediateDeallocationImpl (TC , NP->getDecl (), initExpr,
1797
+ diagnoseUnownedImmediateDeallocationImpl (ctx , NP->getDecl (), initExpr,
1797
1798
equalLoc,
1798
1799
initExpr->getSourceRange ());
1799
1800
}
0 commit comments