Skip to content

Commit ba5f818

Browse files
[gardening] Remove unused variables
1 parent b1e5d85 commit ba5f818

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

lib/IRGen/LoadableByAddress.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ static bool containsLargeLoadable(GenericEnvironment *GenericEnv,
107107
currSILFunctionType->getParameters(), Mod)) {
108108
return true;
109109
}
110-
} else if (auto *currSILBlockType =
111-
dyn_cast<SILBlockStorageType>(currCanType.getPointer())) {
110+
} else if (isa<SILBlockStorageType>(currCanType.getPointer())) {
112111
continue;
113112
} else {
114113
switch (param.getConvention()) {
@@ -303,8 +302,7 @@ static SILType getNewSILType(GenericEnvironment *GenericEnv,
303302
return newSILType;
304303
}
305304
CanType currCanType = storageType.getSwiftRValueType();
306-
if (auto *currSILBlockType =
307-
dyn_cast<SILBlockStorageType>(currCanType.getPointer())) {
305+
if (isa<SILBlockStorageType>(currCanType.getPointer())) {
308306
return storageType;
309307
}
310308
if (SILFunctionType *currSILFunctionType =
@@ -693,14 +691,14 @@ void LargeValueVisitor::visitTupleInst(SILInstruction *instr) {
693691

694692
void LargeValueVisitor::visitAllocStackInst(AllocStackInst *instr) {
695693
SILType currSILType = instr->getType().getObjectType();
696-
if (auto *fType = getInnerFunctionType(currSILType)) {
694+
if (getInnerFunctionType(currSILType)) {
697695
pass.allocStackInstsToMod.push_back(instr);
698696
}
699697
}
700698

701699
void LargeValueVisitor::visitPointerToAddressInst(PointerToAddressInst *instr) {
702700
SILType currSILType = instr->getType().getObjectType();
703-
if (auto *fType = getInnerFunctionType(currSILType)) {
701+
if (getInnerFunctionType(currSILType)) {
704702
pass.pointerToAddrkInstsToMod.push_back(instr);
705703
}
706704
}

lib/SILOptimizer/IPO/DeadFunctionElimination.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ class FunctionLivenessComputation {
210210
ensureAliveClassMethod(getMethodInfo(decl, /*witness*/ false),
211211
dyn_cast<FuncDecl>(decl),
212212
clas);
213-
} else if (auto proto =
214-
dyn_cast<ProtocolDecl>(decl->getDeclContext())) {
213+
} else if (isa<ProtocolDecl>(decl->getDeclContext())) {
215214
ensureAliveProtocolMethod(getMethodInfo(decl, /*witness*/ true));
216215
} else {
217216
llvm_unreachable("key path keyed by a non-class, non-protocol method");

0 commit comments

Comments
 (0)