Skip to content

Commit b64c620

Browse files
authored
Merge pull request swiftlang#28860 from gottesmm/pr-ecaea6466ae4502fe6e1cf51edc06fc272c228bf
2 parents e1663c9 + 6896000 commit b64c620

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

lib/SILGen/SILGenConvert.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,10 @@ ManagedValue SILGenFunction::emitExistentialErasure(
827827
loc, SILType::getPrimitiveObjectType(anyObjectTy), concreteFormalType,
828828
concreteValue, {});
829829
};
830-
831-
auto concreteTLPtr = &concreteTL;
830+
832831
if (this->F.getLoweredFunctionType()->isPseudogeneric()) {
833832
if (anyObjectTy && concreteFormalType->is<ArchetypeType>()) {
834833
concreteFormalType = anyObjectTy;
835-
concreteTLPtr = &getTypeLowering(anyObjectTy);
836834
F = eraseToAnyObject;
837835
}
838836
}

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ ExistentialTransform::createExistentialSpecializedFunctionType() {
322322
SILModule &M = F->getModule();
323323
auto &Ctx = M.getASTContext();
324324
GenericSignature NewGenericSig;
325-
GenericEnvironment *NewGenericEnv;
326325

327326
/// If the original function is generic, then maintain the same.
328327
auto OrigGenericSig = FTy->getInvocationGenericSignature();
@@ -341,8 +340,6 @@ ExistentialTransform::createExistentialSpecializedFunctionType() {
341340
std::move(Requirements)},
342341
GenericSignature());
343342

344-
NewGenericEnv = NewGenericSig->getGenericEnvironment();
345-
346343
/// Create a lambda for GenericParams.
347344
auto getCanonicalType = [&](Type t) -> CanType {
348345
return t->getCanonicalType(NewGenericSig);

lib/SILOptimizer/IPO/GlobalOpt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ static SILFunction *genGetterFromInit(SILOptFunctionBuilder &FunctionBuilder,
567567
// Find the store instruction
568568
auto *BB = GetterF->getEntryBlock();
569569
SILValue Val;
570-
SILInstruction *Store;
570+
SILInstruction *Store = nullptr;
571571
for (auto II = BB->begin(), E = BB->end(); II != E;) {
572572
auto &I = *II++;
573573
if (isa<AllocGlobalInst>(&I)) {
@@ -586,6 +586,7 @@ static SILFunction *genGetterFromInit(SILOptFunctionBuilder &FunctionBuilder,
586586
B.createReturn(RI->getLoc(), Val);
587587
eraseUsesOfInstruction(RI);
588588
recursivelyDeleteTriviallyDeadInstructions(RI, true);
589+
assert(Store && "Did not find a store?!");
589590
recursivelyDeleteTriviallyDeadInstructions(Store, true);
590591
return GetterF;
591592
}

lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,13 @@ visitPointerToAddressInst(PointerToAddressInst *PTAI) {
164164
// %addr = pointer_to_address %ptr, [strict] $T
165165
// %result = index_addr %addr, %distance
166166
//
167-
BuiltinInst *Bytes;
167+
BuiltinInst *Bytes = nullptr;
168168
if (match(PTAI->getOperand(),
169169
m_IndexRawPointerInst(
170170
m_ValueBase(),
171171
m_TupleExtractOperation(m_BuiltinInst(Bytes), 0)))) {
172+
assert(Bytes != nullptr &&
173+
"Bytes should have been assigned a non-null value");
172174
if (match(Bytes, m_ApplyInst(BuiltinValueKind::SMulOver, m_ValueBase(),
173175
m_ApplyInst(BuiltinValueKind::Strideof,
174176
m_MetatypeInst(Metatype)),

0 commit comments

Comments
 (0)