Skip to content

Commit 3615b0e

Browse files
technicatedToma91
authored andcommitted
Inlined and removed a method from SILGenModule
There is no need for a 'emitKeyPathComponentForTupleElement' method because there is not so much work to do there
1 parent bad2230 commit 3615b0e

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

lib/SILGen/SILGen.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
359359
CanType baseTy,
360360
bool forPropertyDescriptor);
361361

362-
KeyPathPatternComponent
363-
emitKeyPathComponentForTupleElement(unsigned tupleIndex, CanType baseTy);
364-
365362
/// Known functions for bridging.
366363
SILDeclRef getStringToNSStringFn();
367364
SILDeclRef getNSStringToStringFn();

lib/SILGen/SILGenExpr.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,18 +3574,6 @@ SILGenModule::emitKeyPathComponentForDecl(SILLocation loc,
35743574
llvm_unreachable("unknown kind of storage");
35753575
}
35763576

3577-
KeyPathPatternComponent
3578-
SILGenModule::emitKeyPathComponentForTupleElement(unsigned tupleIndex,
3579-
CanType baseTy) {
3580-
assert(baseTy->is<TupleType>() && "baseTy is expected to be a TupleType");
3581-
3582-
auto elementTy = baseTy->getAs<TupleType>()
3583-
->getElementType(tupleIndex)
3584-
->getCanonicalType();
3585-
3586-
return KeyPathPatternComponent::forTupleElement(tupleIndex, elementTy);
3587-
}
3588-
35893577
RValue RValueEmitter::visitKeyPathExpr(KeyPathExpr *E, SGFContext C) {
35903578
if (E->isObjC()) {
35913579
return visit(E->getObjCStringLiteralExpr(), C);
@@ -3657,10 +3645,15 @@ RValue RValueEmitter::visitKeyPathExpr(KeyPathExpr *E, SGFContext C) {
36573645
}
36583646

36593647
case KeyPathExpr::Component::Kind::TupleElement: {
3648+
assert(baseTy->is<TupleType>() && "baseTy is expected to be a TupleType");
3649+
36603650
auto tupleIndex = component.getTupleIndex();
3651+
auto elementTy = baseTy->getAs<TupleType>()
3652+
->getElementType(tupleIndex)
3653+
->getCanonicalType();
3654+
36613655
loweredComponents.push_back(
3662-
SGF.SGM.emitKeyPathComponentForTupleElement(tupleIndex,
3663-
baseTy));
3656+
KeyPathPatternComponent::forTupleElement(tupleIndex, elementTy));
36643657

36653658
baseTy = loweredComponents.back().getComponentType();
36663659

0 commit comments

Comments
 (0)