@@ -1676,14 +1676,14 @@ void PullbackEmitter::visitBeginBorrowInst(BeginBorrowInst *bbi) {
1676
1676
void PullbackEmitter::visitBeginAccessInst (BeginAccessInst *bai) {
1677
1677
// Check for non-differentiable writes.
1678
1678
if (bai->getAccessKind () == SILAccessKind::Modify) {
1679
- if (auto *gai = dyn_cast <GlobalAddrInst>(bai->getSource ())) {
1679
+ if (isa <GlobalAddrInst>(bai->getSource ())) {
1680
1680
getContext ().emitNondifferentiabilityError (
1681
1681
bai, getInvoker (),
1682
1682
diag::autodiff_cannot_differentiate_writes_to_global_variables);
1683
1683
errorOccurred = true ;
1684
1684
return ;
1685
1685
}
1686
- if (auto *pbi = dyn_cast <ProjectBoxInst>(bai->getSource ())) {
1686
+ if (isa <ProjectBoxInst>(bai->getSource ())) {
1687
1687
getContext ().emitNondifferentiabilityError (
1688
1688
bai, getInvoker (),
1689
1689
diag::autodiff_cannot_differentiate_writes_to_mutable_captures);
@@ -1904,7 +1904,7 @@ AdjointValue PullbackEmitter::accumulateAdjointsDirect(AdjointValue lhs,
1904
1904
SmallVector<AdjointValue, 8 > newElements;
1905
1905
auto lhsTy = lhsVal->getType ().getASTType ();
1906
1906
auto lhsValCopy = builder.emitCopyValueOperation (loc, lhsVal);
1907
- if (auto *tupTy = lhsTy->getAs <TupleType>()) {
1907
+ if (lhsTy->is <TupleType>()) {
1908
1908
auto elts = builder.createDestructureTuple (loc, lhsValCopy);
1909
1909
llvm::for_each (elts->getResults (),
1910
1910
[this ](SILValue result) { recordTemporary (result); });
@@ -1913,7 +1913,7 @@ AdjointValue PullbackEmitter::accumulateAdjointsDirect(AdjointValue lhs,
1913
1913
newElements.push_back (accumulateAdjointsDirect (
1914
1914
makeConcreteAdjointValue (elts->getResult (i)), rhsElt, loc));
1915
1915
}
1916
- } else if (auto *structDecl = lhsTy->getStructOrBoundGenericStruct ()) {
1916
+ } else if (lhsTy->getStructOrBoundGenericStruct ()) {
1917
1917
auto elts =
1918
1918
builder.createDestructureStruct (lhsVal.getLoc (), lhsValCopy);
1919
1919
llvm::for_each (elts->getResults (),
0 commit comments