@@ -552,72 +552,6 @@ AbstractionPattern AbstractionPattern::getFunctionResultType() const {
552
552
llvm_unreachable (" bad kind" );
553
553
}
554
554
555
- AbstractionPattern AbstractionPattern::getFunctionInputType () const {
556
- switch (getKind ()) {
557
- case Kind::Invalid:
558
- llvm_unreachable (" querying invalid abstraction pattern!" );
559
- case Kind::ClangFunctionParamTupleType:
560
- case Kind::ObjCMethodParamTupleType:
561
- case Kind::ObjCMethodFormalParamTupleType:
562
- case Kind::CFunctionAsMethodParamTupleType:
563
- case Kind::CFunctionAsMethodFormalParamTupleType:
564
- case Kind::Tuple:
565
- llvm_unreachable (" abstraction pattern for tuple cannot be function" );
566
- case Kind::Opaque:
567
- return *this ;
568
- case Kind::Type:
569
- if (isTypeParameter ())
570
- return AbstractionPattern::getOpaque ();
571
- return AbstractionPattern (getGenericSignatureForFunctionComponent (),
572
- cast<AnyFunctionType>(getType ()).getInput ());
573
- case Kind::Discard:
574
- llvm_unreachable (" don't need to discard function abstractions yet" );
575
- case Kind::ClangType: {
576
- // Preserve the Clang type in the resulting abstraction pattern.
577
- auto inputType = cast<AnyFunctionType>(getType ()).getInput ();
578
- if (isa<TupleType>(inputType)) {
579
- return getClangFunctionParamTuple (
580
- getGenericSignatureForFunctionComponent (),
581
- inputType, getClangType ());
582
- } else {
583
- return AbstractionPattern (getGenericSignatureForFunctionComponent (),
584
- inputType,
585
- getClangFunctionParameterType (getClangType (), 0 ));
586
- }
587
- }
588
- case Kind::CurriedCFunctionAsMethodType:
589
- return getCFunctionAsMethodSelfPattern (
590
- cast<AnyFunctionType>(getType ()).getInput ());
591
- case Kind::PartialCurriedCFunctionAsMethodType:
592
- return getCFunctionAsMethodFormalParamPattern (
593
- cast<AnyFunctionType>(getType ()).getInput ());
594
- case Kind::CurriedObjCMethodType:
595
- return getObjCMethodSelfPattern (
596
- cast<AnyFunctionType>(getType ()).getInput ());
597
- case Kind::PartialCurriedObjCMethodType:
598
- return getObjCMethodFormalParamPattern (
599
- cast<AnyFunctionType>(getType ()).getInput ());
600
- case Kind::CFunctionAsMethodType: {
601
- // Preserve the Clang type in the resulting abstraction pattern.
602
- auto inputType = cast<AnyFunctionType>(getType ()).getInput ();
603
- assert (isa<TupleType>(inputType)); // always at least ((), SelfType)
604
- return getCFunctionAsMethodParamTuple (
605
- getGenericSignatureForFunctionComponent (),
606
- inputType, getClangType (),
607
- getImportAsMemberStatus ());
608
- }
609
- case Kind::ObjCMethodType: {
610
- // Preserve the Clang type in the resulting abstraction pattern.
611
- auto inputType = cast<AnyFunctionType>(getType ()).getInput ();
612
- assert (isa<TupleType>(inputType)); // always at least ((), SelfType)
613
- return getObjCMethodParamTuple (getGenericSignatureForFunctionComponent (),
614
- inputType, getObjCMethod (),
615
- getEncodedForeignErrorInfo ());
616
- }
617
- }
618
- llvm_unreachable (" bad kind" );
619
- }
620
-
621
555
AbstractionPattern
622
556
AbstractionPattern::getFunctionParamType (unsigned index) const {
623
557
switch (getKind ()) {
0 commit comments