Skip to content

Commit 8b5298e

Browse files
committed
Fix release build warnings about uninitialized variables.
1 parent 28b71e1 commit 8b5298e

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

lib/AST/ASTContext.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,7 @@ ASTContext::createTrivialSubstitutions(BoundGenericType *BGT,
12101210
assert(Params.size() == 1);
12111211
auto Param = Params[0];
12121212
assert(Param->getArchetype() && "Not type-checked yet");
1213+
(void) Param;
12131214
Substitution Subst(BGT->getGenericArgs()[0], {});
12141215
auto Substitutions = AllocateCopy(llvm::makeArrayRef(Subst));
12151216
auto arena = getArena(BGT->getRecursiveProperties());

lib/SIL/Projection.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ NewProjection::NewProjection(SILInstruction *I) : Value() {
9898
assert(getIndex() == 0);
9999
assert(getType(PBI->getOperand().getType(), PBI->getModule()) ==
100100
PBI->getType());
101+
(void) PBI;
101102
break;
102103
}
103104
case ValueKind::TupleExtractInst: {
@@ -311,6 +312,7 @@ void NewProjection::getFirstLevelProjections(
311312
assert(X.getMostDerivedType(Mod) == SILType::getPrimitiveAddressType(
312313
Box->getBoxedType()));
313314
X.verify(Mod););
315+
(void) Box;
314316
Out.push_back(P);
315317
return;
316318
}

lib/SILGen/SILGenDynamicCast.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ static RValue emitCollectionDowncastExpr(SILGenFunction &SGF,
329329
auto toSubsts = toCollection->getSubstitutions(SGF.SGM.SwiftModule,nullptr);
330330
assert(fnArcheTypes.size() == fromSubsts.size() + toSubsts.size() &&
331331
"wrong number of generic collection parameters");
332+
(void) fnArcheTypes;
332333

333334
// Form type parameter substitutions.
334335
SmallVector<Substitution, 4> subs;

lib/SILGen/SILGenExpr.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ visitCollectionUpcastConversionExpr(CollectionUpcastConversionExpr *E,
10891089
auto toSubsts = toCollection->getSubstitutions(SGF.SGM.SwiftModule,nullptr);
10901090
assert(fnArcheTypes.size() == fromSubsts.size() + toSubsts.size() &&
10911091
"wrong number of generic collection parameters");
1092+
(void) fnArcheTypes;
10921093

10931094
// Form type parameter substitutions.
10941095
SmallVector<Substitution, 4> subs;

lib/SILOptimizer/LoopTransforms/LoopRotate.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ updateSSAForUseOfInst(SILSSAUpdater &Updater,
113113
// Find the mapped instruction.
114114
assert(ValueMap.count(Inst) && "Expected to find value in map!");
115115
SILValue MappedValue = ValueMap.find(Inst)->second;
116-
auto *MappedInst = MappedValue.getDef();
117116
assert(MappedValue);
118-
assert(MappedInst);
119117

120118
// For each use of a specific result value of the instruction.
121119
if (Inst->hasValue()) {

0 commit comments

Comments
 (0)