@@ -1565,9 +1565,6 @@ class ResultPlanner {
1565
1565
// /
1566
1566
// / Valid: reabstraction info, InnerResult, OuterResult.
1567
1567
ReabstractDirectToDirect,
1568
-
1569
- // / Ignore the next direct inner result, since the outer is 'Void'.
1570
- IgnoreDirectResult,
1571
1568
};
1572
1569
1573
1570
Operation (Kind kind) : TheKind(kind) {}
@@ -1712,24 +1709,6 @@ class ResultPlanner {
1712
1709
SILResultInfo outerResult,
1713
1710
SILValue optOuterResultAddr);
1714
1711
1715
- void planIgnoredResult (AbstractionPattern innerOrigType,
1716
- CanType innerSubstType, PlanData &planData) {
1717
- if (innerOrigType.isTuple ()) {
1718
- auto innerSubstTuple = cast<TupleType>(innerSubstType);
1719
- for (unsigned i = 0 , n = innerSubstTuple->getNumElements (); i != n; ++i)
1720
- planIgnoredResult (innerOrigType.getTupleElementType (i),
1721
- innerSubstTuple.getElementType (i), planData);
1722
- return ;
1723
- }
1724
-
1725
- auto innerResult = claimNextInnerResult (planData);
1726
- if (innerResult.isFormalIndirect () &&
1727
- SGF.silConv .isSILIndirect (innerResult))
1728
- (void )addInnerIndirectResultTemporary (planData, innerResult);
1729
- else
1730
- addIgnoreDirectResult ();
1731
- }
1732
-
1733
1712
// / Claim the next inner result from the plan data.
1734
1713
SILResultInfo claimNextInnerResult (PlanData &data) {
1735
1714
return claimNext (data.InnerResults );
@@ -1879,10 +1858,6 @@ class ResultPlanner {
1879
1858
op.OuterOrigType = outerOrigType;
1880
1859
op.OuterSubstType = outerSubstType;
1881
1860
}
1882
-
1883
- void addIgnoreDirectResult () {
1884
- (void )addOperation (Operation::IgnoreDirectResult);
1885
- }
1886
1861
};
1887
1862
1888
1863
} // end anonymous namespace
@@ -1893,13 +1868,6 @@ void ResultPlanner::plan(AbstractionPattern innerOrigType,
1893
1868
AbstractionPattern outerOrigType,
1894
1869
CanType outerSubstType,
1895
1870
PlanData &planData) {
1896
- // Conversion from `() -> T` to `() -> Void` is allowed when
1897
- // the argument is a closure.
1898
- if (!innerSubstType->isVoid () && outerSubstType->isVoid ()) {
1899
- planIgnoredResult (innerOrigType, innerSubstType, planData);
1900
- return ;
1901
- }
1902
-
1903
1871
// The substituted types must match up in tuple-ness and arity.
1904
1872
assert (isa<TupleType>(innerSubstType) == isa<TupleType>(outerSubstType) ||
1905
1873
(isa<TupleType>(innerSubstType) &&
@@ -2612,10 +2580,6 @@ void ResultPlanner::execute(ArrayRef<SILValue> innerDirectResults,
2612
2580
case Operation::InjectOptionalIndirect:
2613
2581
SGF.B .createInjectEnumAddr (Loc, op.OuterResultAddr , op.SomeDecl );
2614
2582
continue ;
2615
-
2616
- case Operation::IgnoreDirectResult:
2617
- (void )claimNext (innerDirectResults);
2618
- continue ;
2619
2583
}
2620
2584
llvm_unreachable (" bad operation kind" );
2621
2585
}
0 commit comments