Skip to content

Commit 7f4de17

Browse files
authored
Merge pull request #11726 from slavapestov/fix-unused-warnings
Gardening: Fix unused variable warnings
2 parents 55297ae + 5973a27 commit 7f4de17

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

lib/AST/DeclContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ unsigned DeclContext::getSyntacticDepth() const {
658658

659659
unsigned DeclContext::getSemanticDepth() const {
660660
// For extensions, count the depth of the nominal type being extended.
661-
if (auto ext = dyn_cast<ExtensionDecl>(this)) {
661+
if (isa<ExtensionDecl>(this)) {
662662
if (auto nominal = getAsNominalTypeOrNominalTypeExtensionContext())
663663
return nominal->getSemanticDepth();
664664

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5346,7 +5346,7 @@ Decl *SwiftDeclConverter::importGlobalAsMethod(
53465346
dc->getAsNominalTypeOrNominalTypeExtensionContext()) {
53475347
if (auto clangDCTy = dyn_cast_or_null<clang::TypedefNameDecl>(
53485348
nominalTypeDecl->getClangDecl()))
5349-
if (auto newtypeAttr = getSwiftNewtypeAttr(clangDCTy, getVersion()))
5349+
if (getSwiftNewtypeAttr(clangDCTy, getVersion()))
53505350
if (clangDCTy->getUnderlyingType().getCanonicalType() !=
53515351
selfParamTy->getPointeeType().getCanonicalType())
53525352
selfIsInOut = false;

lib/SILGen/SILGenBridging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ static ManagedValue emitCBridgedToNativeValue(SILGenFunction &SGF,
941941
}
942942

943943
// Bridge Objective-C to thick metatypes.
944-
if (auto nativeMetaTy = dyn_cast<AnyMetatypeType>(nativeType)) {
944+
if (isa<AnyMetatypeType>(nativeType)) {
945945
auto bridgedMetaTy = cast<AnyMetatypeType>(bridgedType);
946946
if (bridgedMetaTy->hasRepresentation() &&
947947
bridgedMetaTy->getRepresentation() == MetatypeRepresentation::ObjC) {

lib/SILOptimizer/Mandatory/AccessEnforcementSelection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void SelectEnforcement::analyzeProjection(ProjectBoxInst *projection) {
255255

256256
continue;
257257
}
258-
if (auto *PAI = dyn_cast<PartialApplyInst>(user))
258+
if (isa<PartialApplyInst>(user))
259259
Captures.emplace_back(AddressCapture(*use));
260260
}
261261
}

lib/SILOptimizer/Utils/Local.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ optimizeBridgedObjCToSwiftCast(SILInstruction *Inst,
15171517
auto *AI = Builder.createApply(Loc, FuncRef, Subs, Args, false);
15181518

15191519
// If the source of a cast should be destroyed, emit a release.
1520-
if (auto *UCCAI = dyn_cast<UnconditionalCheckedCastAddrInst>(Inst)) {
1520+
if (isa<UnconditionalCheckedCastAddrInst>(Inst)) {
15211521
Builder.createReleaseValue(Loc, SrcOp, Builder.getDefaultAtomicity());
15221522
}
15231523

lib/Sema/CSDiag.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,7 @@ diagnoseTypeMemberOnInstanceLookup(Type baseObjTy,
24652465
Diag.emplace(diagnose(loc,
24662466
diag::assoc_type_outside_of_protocol,
24672467
ATD->getName()));
2468-
} else if (auto CD = dyn_cast<ConstructorDecl>(member)) {
2468+
} else if (isa<ConstructorDecl>(member)) {
24692469
Diag.emplace(diagnose(loc,
24702470
diag::construct_protocol_by_name,
24712471
metatypeTy->getInstanceType()));
@@ -5508,13 +5508,13 @@ static bool isRawRepresentableMismatch(Type fromType, Type toType,
55085508
// First check if this is an attempt to convert from something to
55095509
// raw representable.
55105510
if (conformsToKnownProtocol(fromType, kind, CS)) {
5511-
if (auto rawType = isRawRepresentable(toType, kind, CS))
5511+
if (isRawRepresentable(toType, kind, CS))
55125512
return true;
55135513
}
55145514

55155515
// Otherwise, it might be an attempt to convert from raw representable
55165516
// to its raw value.
5517-
if (auto rawType = isRawRepresentable(fromType, kind, CS)) {
5517+
if (isRawRepresentable(fromType, kind, CS)) {
55185518
if (conformsToKnownProtocol(toType, kind, CS))
55195519
return true;
55205520
}

0 commit comments

Comments
 (0)