@@ -162,11 +162,6 @@ class AbstractionPattern {
162
162
Discard,
163
163
// / A type reference with a Clang type. OrigType and ClangType are valid.
164
164
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,
170
165
// / The curried imported type of an Objective-C method (that is,
171
166
// / 'Self -> Input -> Result'). OrigType is valid and is a function
172
167
// / type. ObjCMethod is valid. OtherData is an encoded foreign
@@ -181,10 +176,6 @@ class AbstractionPattern {
181
176
// / OrigType is valid and is a function type. ClangType is valid and is
182
177
// / a function type. OtherData is an encoded ImportAsMemberStatus.
183
178
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,
188
179
// / The curried imported type of a C function imported as a method.
189
180
// / OrigType is valid and is a function type. ClangType is valid and is
190
181
// / a function type. OtherData is an encoded ImportAsMemberStatus.
@@ -199,23 +190,6 @@ class AbstractionPattern {
199
190
// / type. ObjCMethod is valid. OtherData is an encoded foreign
200
191
// / error index.
201
192
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,
219
193
};
220
194
221
195
class EncodedForeignErrorInfo {
@@ -294,12 +268,9 @@ class AbstractionPattern {
294
268
bool hasStoredClangType () const {
295
269
switch (getKind ()) {
296
270
case Kind::ClangType:
297
- case Kind::ClangFunctionParamTupleType:
298
271
case Kind::CFunctionAsMethodType:
299
- case Kind::CFunctionAsMethodParamTupleType:
300
272
case Kind::CurriedCFunctionAsMethodType:
301
273
case Kind::PartialCurriedCFunctionAsMethodType:
302
- case Kind::CFunctionAsMethodFormalParamTupleType:
303
274
return true ;
304
275
305
276
default :
@@ -312,8 +283,6 @@ class AbstractionPattern {
312
283
case Kind::CurriedObjCMethodType:
313
284
case Kind::PartialCurriedObjCMethodType:
314
285
case Kind::ObjCMethodType:
315
- case Kind::ObjCMethodParamTupleType:
316
- case Kind::ObjCMethodFormalParamTupleType:
317
286
return true ;
318
287
319
288
default :
@@ -328,10 +297,8 @@ class AbstractionPattern {
328
297
bool hasImportAsMemberStatus () const {
329
298
switch (getKind ()) {
330
299
case Kind::CFunctionAsMethodType:
331
- case Kind::CFunctionAsMethodParamTupleType:
332
300
case Kind::CurriedCFunctionAsMethodType:
333
301
case Kind::PartialCurriedCFunctionAsMethodType:
334
- case Kind::CFunctionAsMethodFormalParamTupleType:
335
302
return true ;
336
303
337
304
default :
@@ -423,19 +390,6 @@ class AbstractionPattern {
423
390
return pattern;
424
391
}
425
392
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
-
439
393
public:
440
394
// / Return an abstraction pattern for the curried type of an
441
395
// / Objective-C method.
@@ -574,43 +528,6 @@ class AbstractionPattern {
574
528
return pattern;
575
529
}
576
530
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
-
614
531
// / Return a pattern corresponding to the 'self' parameter of the
615
532
// / current Objective-C method.
616
533
AbstractionPattern getObjCMethodSelfPattern (CanType paramType) const ;
@@ -628,34 +545,6 @@ class AbstractionPattern {
628
545
AbstractionPattern getCFunctionAsMethodFormalParamPattern (CanType paramType)
629
546
const ;
630
547
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
-
659
548
public:
660
549
// / Return an abstraction pattern with an added level of optionality.
661
550
// /
@@ -721,17 +610,12 @@ class AbstractionPattern {
721
610
case Kind::Tuple:
722
611
llvm_unreachable (" open-coded tuple pattern has no type" );
723
612
case Kind::ClangType:
724
- case Kind::ClangFunctionParamTupleType:
725
613
case Kind::CurriedObjCMethodType:
726
614
case Kind::PartialCurriedObjCMethodType:
727
615
case Kind::ObjCMethodType:
728
- case Kind::ObjCMethodParamTupleType:
729
- case Kind::ObjCMethodFormalParamTupleType:
730
616
case Kind::CFunctionAsMethodType:
731
- case Kind::CFunctionAsMethodParamTupleType:
732
617
case Kind::CurriedCFunctionAsMethodType:
733
618
case Kind::PartialCurriedCFunctionAsMethodType:
734
- case Kind::CFunctionAsMethodFormalParamTupleType:
735
619
case Kind::Type:
736
620
case Kind::Discard:
737
621
return OrigType;
@@ -757,17 +641,12 @@ class AbstractionPattern {
757
641
case Kind::Tuple:
758
642
llvm_unreachable (" type cannot be replaced on pattern without type" );
759
643
case Kind::ClangType:
760
- case Kind::ClangFunctionParamTupleType:
761
644
case Kind::CurriedObjCMethodType:
762
645
case Kind::PartialCurriedObjCMethodType:
763
646
case Kind::ObjCMethodType:
764
- case Kind::ObjCMethodParamTupleType:
765
- case Kind::ObjCMethodFormalParamTupleType:
766
647
case Kind::CFunctionAsMethodType:
767
- case Kind::CFunctionAsMethodParamTupleType:
768
648
case Kind::CurriedCFunctionAsMethodType:
769
649
case Kind::PartialCurriedCFunctionAsMethodType:
770
- case Kind::CFunctionAsMethodFormalParamTupleType:
771
650
case Kind::Type:
772
651
case Kind::Discard:
773
652
assert (signature || !type->hasTypeParameter ());
@@ -794,17 +673,12 @@ class AbstractionPattern {
794
673
case Kind::Discard:
795
674
return false ;
796
675
case Kind::ClangType:
797
- case Kind::ClangFunctionParamTupleType:
798
676
case Kind::PartialCurriedObjCMethodType:
799
677
case Kind::CurriedObjCMethodType:
800
678
case Kind::ObjCMethodType:
801
- case Kind::ObjCMethodParamTupleType:
802
- case Kind::ObjCMethodFormalParamTupleType:
803
679
case Kind::CFunctionAsMethodType:
804
- case Kind::CFunctionAsMethodParamTupleType:
805
680
case Kind::CurriedCFunctionAsMethodType:
806
681
case Kind::PartialCurriedCFunctionAsMethodType:
807
- case Kind::CFunctionAsMethodFormalParamTupleType:
808
682
return true ;
809
683
}
810
684
llvm_unreachable (" bad kind" );
@@ -848,20 +722,15 @@ class AbstractionPattern {
848
722
case Kind::Invalid:
849
723
llvm_unreachable (" querying invalid abstraction pattern!" );
850
724
case Kind::Tuple:
851
- case Kind::ClangFunctionParamTupleType:
852
- case Kind::ObjCMethodParamTupleType:
853
- case Kind::ObjCMethodFormalParamTupleType:
854
725
llvm_unreachable (" querying foreign-error bits on non-function pattern" );
855
726
856
727
case Kind::Opaque:
857
728
case Kind::ClangType:
858
729
case Kind::Type:
859
730
case Kind::Discard:
860
731
case Kind::CFunctionAsMethodType:
861
- case Kind::CFunctionAsMethodParamTupleType:
862
732
case Kind::CurriedCFunctionAsMethodType:
863
733
case Kind::PartialCurriedCFunctionAsMethodType:
864
- case Kind::CFunctionAsMethodFormalParamTupleType:
865
734
return false ;
866
735
case Kind::PartialCurriedObjCMethodType:
867
736
case Kind::CurriedObjCMethodType:
@@ -884,17 +753,12 @@ class AbstractionPattern {
884
753
case Kind::Tuple:
885
754
return typename CanTypeWrapperTraits<TYPE>::type ();
886
755
case Kind::ClangType:
887
- case Kind::ClangFunctionParamTupleType:
888
756
case Kind::PartialCurriedObjCMethodType:
889
757
case Kind::CurriedObjCMethodType:
890
758
case Kind::ObjCMethodType:
891
- case Kind::ObjCMethodParamTupleType:
892
- case Kind::ObjCMethodFormalParamTupleType:
893
759
case Kind::CFunctionAsMethodType:
894
- case Kind::CFunctionAsMethodParamTupleType:
895
760
case Kind::CurriedCFunctionAsMethodType:
896
761
case Kind::PartialCurriedCFunctionAsMethodType:
897
- case Kind::CFunctionAsMethodFormalParamTupleType:
898
762
case Kind::Type:
899
763
case Kind::Discard:
900
764
return dyn_cast<TYPE>(getType ());
@@ -914,17 +778,12 @@ class AbstractionPattern {
914
778
case Kind::Opaque:
915
779
case Kind::Tuple:
916
780
case Kind::ClangType:
917
- case Kind::ClangFunctionParamTupleType:
918
781
case Kind::PartialCurriedObjCMethodType:
919
782
case Kind::CurriedObjCMethodType:
920
783
case Kind::ObjCMethodType:
921
- case Kind::ObjCMethodParamTupleType:
922
- case Kind::ObjCMethodFormalParamTupleType:
923
784
case Kind::CFunctionAsMethodType:
924
- case Kind::CFunctionAsMethodParamTupleType:
925
785
case Kind::CurriedCFunctionAsMethodType:
926
786
case Kind::PartialCurriedCFunctionAsMethodType:
927
- case Kind::CFunctionAsMethodFormalParamTupleType:
928
787
// We assume that the Clang type might provide additional structure.
929
788
return false ;
930
789
case Kind::Type:
@@ -951,11 +810,6 @@ class AbstractionPattern {
951
810
case Kind::ObjCMethodType:
952
811
return false ;
953
812
case Kind::Tuple:
954
- case Kind::CFunctionAsMethodParamTupleType:
955
- case Kind::ClangFunctionParamTupleType:
956
- case Kind::ObjCMethodParamTupleType:
957
- case Kind::ObjCMethodFormalParamTupleType:
958
- case Kind::CFunctionAsMethodFormalParamTupleType:
959
813
return true ;
960
814
case Kind::Type:
961
815
case Kind::Discard:
@@ -982,11 +836,6 @@ class AbstractionPattern {
982
836
case Kind::Type:
983
837
case Kind::Discard:
984
838
case Kind::ClangType:
985
- case Kind::ClangFunctionParamTupleType:
986
- case Kind::CFunctionAsMethodParamTupleType:
987
- case Kind::ObjCMethodParamTupleType:
988
- case Kind::ObjCMethodFormalParamTupleType:
989
- case Kind::CFunctionAsMethodFormalParamTupleType:
990
839
return cast<TupleType>(getType ())->getNumElements ();
991
840
}
992
841
llvm_unreachable (" bad kind" );
@@ -996,18 +845,10 @@ class AbstractionPattern {
996
845
// / the abstraction pattern for its object type.
997
846
AbstractionPattern getTupleElementType (unsigned index) const ;
998
847
999
- // / Given that the value being abstracted is an l-value or inout type,
1000
- // / return the abstraction pattern for its object type.
1001
- AbstractionPattern getWithoutSpecifierType () const ;
1002
-
1003
848
// / Given that the value being abstracted is a function, return the
1004
849
// / abstraction pattern for its result type.
1005
850
AbstractionPattern getFunctionResultType () const ;
1006
851
1007
- // / Given that the value being abstracted is a function, return the
1008
- // / abstraction pattern for its input type.
1009
- AbstractionPattern getFunctionInputType () const ;
1010
-
1011
852
// / Given that the value being abstracted is a function type, return
1012
853
// / the abstraction pattern for one of its parameter types.
1013
854
AbstractionPattern getFunctionParamType (unsigned index) const ;
0 commit comments