Skip to content

Commit e7b911e

Browse files
committed
SIL: Remove no longer used AbstractionPattern kinds
1 parent e8bb14c commit e7b911e

File tree

2 files changed

+4
-356
lines changed

2 files changed

+4
-356
lines changed

include/swift/SIL/AbstractionPattern.h

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,6 @@ class AbstractionPattern {
162162
Discard,
163163
/// A type reference with a Clang type. OrigType and ClangType are valid.
164164
ClangType,
165-
/// A reference to the parameters of a Clang function type,
166-
/// imported as a tuple type. OrigType is valid and is a tuple
167-
/// type. ClangType is valid and is a function type, a function
168-
/// pointer type, or a block pointer type.
169-
ClangFunctionParamTupleType,
170165
/// The curried imported type of an Objective-C method (that is,
171166
/// 'Self -> Input -> Result'). OrigType is valid and is a function
172167
/// type. ObjCMethod is valid. OtherData is an encoded foreign
@@ -181,10 +176,6 @@ class AbstractionPattern {
181176
/// OrigType is valid and is a function type. ClangType is valid and is
182177
/// a function type. OtherData is an encoded ImportAsMemberStatus.
183178
CFunctionAsMethodType,
184-
/// The uncurried parameter tuple type of a C function imported as a method.
185-
/// OrigType is valid and is a function type. ClangType is valid and is
186-
/// a tuple type. OtherData is an encoded ImportAsMemberStatus.
187-
CFunctionAsMethodParamTupleType,
188179
/// The curried imported type of a C function imported as a method.
189180
/// OrigType is valid and is a function type. ClangType is valid and is
190181
/// a function type. OtherData is an encoded ImportAsMemberStatus.
@@ -199,23 +190,6 @@ class AbstractionPattern {
199190
/// type. ObjCMethod is valid. OtherData is an encoded foreign
200191
/// error index.
201192
ObjCMethodType,
202-
/// A reference to the uncurried parameters of a Clang Objective-C
203-
/// method type, imported as a tuple type (that is, '(Input,
204-
/// Self'). OrigType is valid and is a tuple type with two
205-
/// elements. ObjCMethod is valid. OtherData is an encoded
206-
/// foreign error index.
207-
ObjCMethodParamTupleType,
208-
/// A reference to the formal parameters of a Clang Objective-C
209-
/// method type when they were imported as a tuple type (that is,
210-
/// 'Input', if it's a tuple type). OrigType is valid and is a
211-
/// tuple type. ObjCMethod is valid. OtherData is an encoded
212-
/// foreign error index.
213-
ObjCMethodFormalParamTupleType,
214-
/// A reference to the formal method parameters of a C function that was
215-
/// imported as a method.
216-
/// OrigType is valid and is a tuple type. ClangType is valid and is
217-
/// a function type. OtherData is an encoded ImportAsMemberStatus.
218-
CFunctionAsMethodFormalParamTupleType,
219193
};
220194

221195
class EncodedForeignErrorInfo {
@@ -294,12 +268,9 @@ class AbstractionPattern {
294268
bool hasStoredClangType() const {
295269
switch (getKind()) {
296270
case Kind::ClangType:
297-
case Kind::ClangFunctionParamTupleType:
298271
case Kind::CFunctionAsMethodType:
299-
case Kind::CFunctionAsMethodParamTupleType:
300272
case Kind::CurriedCFunctionAsMethodType:
301273
case Kind::PartialCurriedCFunctionAsMethodType:
302-
case Kind::CFunctionAsMethodFormalParamTupleType:
303274
return true;
304275

305276
default:
@@ -312,8 +283,6 @@ class AbstractionPattern {
312283
case Kind::CurriedObjCMethodType:
313284
case Kind::PartialCurriedObjCMethodType:
314285
case Kind::ObjCMethodType:
315-
case Kind::ObjCMethodParamTupleType:
316-
case Kind::ObjCMethodFormalParamTupleType:
317286
return true;
318287

319288
default:
@@ -328,10 +297,8 @@ class AbstractionPattern {
328297
bool hasImportAsMemberStatus() const {
329298
switch (getKind()) {
330299
case Kind::CFunctionAsMethodType:
331-
case Kind::CFunctionAsMethodParamTupleType:
332300
case Kind::CurriedCFunctionAsMethodType:
333301
case Kind::PartialCurriedCFunctionAsMethodType:
334-
case Kind::CFunctionAsMethodFormalParamTupleType:
335302
return true;
336303

337304
default:
@@ -423,19 +390,6 @@ class AbstractionPattern {
423390
return pattern;
424391
}
425392

426-
private:
427-
/// Return an abstraction pattern for a tuple representing all the
428-
/// parameters to a C or block function.
429-
static AbstractionPattern
430-
getClangFunctionParamTuple(CanGenericSignature signature, CanType origType,
431-
const clang::Type *clangType) {
432-
assert(isa<TupleType>(origType));
433-
AbstractionPattern pattern;
434-
pattern.initClangType(signature, origType, clangType,
435-
Kind::ClangFunctionParamTupleType);
436-
return pattern;
437-
}
438-
439393
public:
440394
/// Return an abstraction pattern for the curried type of an
441395
/// Objective-C method.
@@ -574,43 +528,6 @@ class AbstractionPattern {
574528
return pattern;
575529
}
576530

577-
/// Return an abstraction pattern for a tuple representing the
578-
/// uncurried parameter clauses of an Objective-C method.
579-
static AbstractionPattern
580-
getObjCMethodParamTuple(CanGenericSignature signature, CanType origType,
581-
const clang::ObjCMethodDecl *method,
582-
EncodedForeignErrorInfo errorInfo) {
583-
assert(isa<TupleType>(origType));
584-
assert(cast<TupleType>(origType)->getNumElements() == 2);
585-
AbstractionPattern pattern;
586-
pattern.initObjCMethod(signature, origType, method,
587-
Kind::ObjCMethodParamTupleType, errorInfo);
588-
return pattern;
589-
}
590-
591-
/// Return an abstraction pattern for a tuple representing the
592-
/// uncurried parameter clauses of a C function imported as a method.
593-
///
594-
/// For example, if the original function is:
595-
/// void CCRefrigatorSetTemperature(CCRefrigeratorRef fridge,
596-
/// CCRefrigeratorCompartment compartment,
597-
/// CCTemperature temperature);
598-
/// then the parameter tuple type is:
599-
/// ((CCRefrigeratorComponent, CCTemperature), CCRefrigerator)
600-
static AbstractionPattern
601-
getCFunctionAsMethodParamTuple(CanGenericSignature signature,
602-
CanType origType,
603-
const clang::Type *type,
604-
ImportAsMemberStatus memberStatus) {
605-
assert(isa<TupleType>(origType));
606-
assert(cast<TupleType>(origType)->getNumElements() == 2);
607-
AbstractionPattern pattern;
608-
pattern.initCFunctionAsMethod(signature, origType, type,
609-
Kind::CFunctionAsMethodParamTupleType,
610-
memberStatus);
611-
return pattern;
612-
}
613-
614531
/// Return a pattern corresponding to the 'self' parameter of the
615532
/// current Objective-C method.
616533
AbstractionPattern getObjCMethodSelfPattern(CanType paramType) const;
@@ -628,34 +545,6 @@ class AbstractionPattern {
628545
AbstractionPattern getCFunctionAsMethodFormalParamPattern(CanType paramType)
629546
const;
630547

631-
/// Return an abstraction pattern for a tuple representing the
632-
/// formal parameters to an Objective-C method.
633-
static AbstractionPattern
634-
getObjCMethodFormalParamTuple(CanGenericSignature signature, CanType origType,
635-
const clang::ObjCMethodDecl *method,
636-
EncodedForeignErrorInfo errorInfo) {
637-
assert(isa<TupleType>(origType));
638-
AbstractionPattern pattern;
639-
pattern.initObjCMethod(signature, origType, method,
640-
Kind::ObjCMethodFormalParamTupleType, errorInfo);
641-
return pattern;
642-
}
643-
644-
/// Return an abstraction pattern for a tuple representing the
645-
/// formal method parameters to a C function imported as a method.
646-
static AbstractionPattern
647-
getCFunctionAsMethodFormalParamTuple(CanGenericSignature signature,
648-
CanType origType,
649-
const clang::Type *type,
650-
ImportAsMemberStatus memberStatus) {
651-
assert(isa<TupleType>(origType));
652-
AbstractionPattern pattern;
653-
pattern.initCFunctionAsMethod(signature, origType, type,
654-
Kind::CFunctionAsMethodFormalParamTupleType,
655-
memberStatus);
656-
return pattern;
657-
}
658-
659548
public:
660549
/// Return an abstraction pattern with an added level of optionality.
661550
///
@@ -721,17 +610,12 @@ class AbstractionPattern {
721610
case Kind::Tuple:
722611
llvm_unreachable("open-coded tuple pattern has no type");
723612
case Kind::ClangType:
724-
case Kind::ClangFunctionParamTupleType:
725613
case Kind::CurriedObjCMethodType:
726614
case Kind::PartialCurriedObjCMethodType:
727615
case Kind::ObjCMethodType:
728-
case Kind::ObjCMethodParamTupleType:
729-
case Kind::ObjCMethodFormalParamTupleType:
730616
case Kind::CFunctionAsMethodType:
731-
case Kind::CFunctionAsMethodParamTupleType:
732617
case Kind::CurriedCFunctionAsMethodType:
733618
case Kind::PartialCurriedCFunctionAsMethodType:
734-
case Kind::CFunctionAsMethodFormalParamTupleType:
735619
case Kind::Type:
736620
case Kind::Discard:
737621
return OrigType;
@@ -757,17 +641,12 @@ class AbstractionPattern {
757641
case Kind::Tuple:
758642
llvm_unreachable("type cannot be replaced on pattern without type");
759643
case Kind::ClangType:
760-
case Kind::ClangFunctionParamTupleType:
761644
case Kind::CurriedObjCMethodType:
762645
case Kind::PartialCurriedObjCMethodType:
763646
case Kind::ObjCMethodType:
764-
case Kind::ObjCMethodParamTupleType:
765-
case Kind::ObjCMethodFormalParamTupleType:
766647
case Kind::CFunctionAsMethodType:
767-
case Kind::CFunctionAsMethodParamTupleType:
768648
case Kind::CurriedCFunctionAsMethodType:
769649
case Kind::PartialCurriedCFunctionAsMethodType:
770-
case Kind::CFunctionAsMethodFormalParamTupleType:
771650
case Kind::Type:
772651
case Kind::Discard:
773652
assert(signature || !type->hasTypeParameter());
@@ -794,17 +673,12 @@ class AbstractionPattern {
794673
case Kind::Discard:
795674
return false;
796675
case Kind::ClangType:
797-
case Kind::ClangFunctionParamTupleType:
798676
case Kind::PartialCurriedObjCMethodType:
799677
case Kind::CurriedObjCMethodType:
800678
case Kind::ObjCMethodType:
801-
case Kind::ObjCMethodParamTupleType:
802-
case Kind::ObjCMethodFormalParamTupleType:
803679
case Kind::CFunctionAsMethodType:
804-
case Kind::CFunctionAsMethodParamTupleType:
805680
case Kind::CurriedCFunctionAsMethodType:
806681
case Kind::PartialCurriedCFunctionAsMethodType:
807-
case Kind::CFunctionAsMethodFormalParamTupleType:
808682
return true;
809683
}
810684
llvm_unreachable("bad kind");
@@ -848,20 +722,15 @@ class AbstractionPattern {
848722
case Kind::Invalid:
849723
llvm_unreachable("querying invalid abstraction pattern!");
850724
case Kind::Tuple:
851-
case Kind::ClangFunctionParamTupleType:
852-
case Kind::ObjCMethodParamTupleType:
853-
case Kind::ObjCMethodFormalParamTupleType:
854725
llvm_unreachable("querying foreign-error bits on non-function pattern");
855726

856727
case Kind::Opaque:
857728
case Kind::ClangType:
858729
case Kind::Type:
859730
case Kind::Discard:
860731
case Kind::CFunctionAsMethodType:
861-
case Kind::CFunctionAsMethodParamTupleType:
862732
case Kind::CurriedCFunctionAsMethodType:
863733
case Kind::PartialCurriedCFunctionAsMethodType:
864-
case Kind::CFunctionAsMethodFormalParamTupleType:
865734
return false;
866735
case Kind::PartialCurriedObjCMethodType:
867736
case Kind::CurriedObjCMethodType:
@@ -884,17 +753,12 @@ class AbstractionPattern {
884753
case Kind::Tuple:
885754
return typename CanTypeWrapperTraits<TYPE>::type();
886755
case Kind::ClangType:
887-
case Kind::ClangFunctionParamTupleType:
888756
case Kind::PartialCurriedObjCMethodType:
889757
case Kind::CurriedObjCMethodType:
890758
case Kind::ObjCMethodType:
891-
case Kind::ObjCMethodParamTupleType:
892-
case Kind::ObjCMethodFormalParamTupleType:
893759
case Kind::CFunctionAsMethodType:
894-
case Kind::CFunctionAsMethodParamTupleType:
895760
case Kind::CurriedCFunctionAsMethodType:
896761
case Kind::PartialCurriedCFunctionAsMethodType:
897-
case Kind::CFunctionAsMethodFormalParamTupleType:
898762
case Kind::Type:
899763
case Kind::Discard:
900764
return dyn_cast<TYPE>(getType());
@@ -914,17 +778,12 @@ class AbstractionPattern {
914778
case Kind::Opaque:
915779
case Kind::Tuple:
916780
case Kind::ClangType:
917-
case Kind::ClangFunctionParamTupleType:
918781
case Kind::PartialCurriedObjCMethodType:
919782
case Kind::CurriedObjCMethodType:
920783
case Kind::ObjCMethodType:
921-
case Kind::ObjCMethodParamTupleType:
922-
case Kind::ObjCMethodFormalParamTupleType:
923784
case Kind::CFunctionAsMethodType:
924-
case Kind::CFunctionAsMethodParamTupleType:
925785
case Kind::CurriedCFunctionAsMethodType:
926786
case Kind::PartialCurriedCFunctionAsMethodType:
927-
case Kind::CFunctionAsMethodFormalParamTupleType:
928787
// We assume that the Clang type might provide additional structure.
929788
return false;
930789
case Kind::Type:
@@ -951,11 +810,6 @@ class AbstractionPattern {
951810
case Kind::ObjCMethodType:
952811
return false;
953812
case Kind::Tuple:
954-
case Kind::CFunctionAsMethodParamTupleType:
955-
case Kind::ClangFunctionParamTupleType:
956-
case Kind::ObjCMethodParamTupleType:
957-
case Kind::ObjCMethodFormalParamTupleType:
958-
case Kind::CFunctionAsMethodFormalParamTupleType:
959813
return true;
960814
case Kind::Type:
961815
case Kind::Discard:
@@ -982,11 +836,6 @@ class AbstractionPattern {
982836
case Kind::Type:
983837
case Kind::Discard:
984838
case Kind::ClangType:
985-
case Kind::ClangFunctionParamTupleType:
986-
case Kind::CFunctionAsMethodParamTupleType:
987-
case Kind::ObjCMethodParamTupleType:
988-
case Kind::ObjCMethodFormalParamTupleType:
989-
case Kind::CFunctionAsMethodFormalParamTupleType:
990839
return cast<TupleType>(getType())->getNumElements();
991840
}
992841
llvm_unreachable("bad kind");

0 commit comments

Comments
 (0)