Skip to content

Commit e8bb14c

Browse files
committed
SIL: Remove AbstractionPattern::getFunctionInputType()
1 parent c99c0c5 commit e8bb14c

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

include/swift/SIL/AbstractionPattern.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,6 @@ class AbstractionPattern {
10001000
/// abstraction pattern for its result type.
10011001
AbstractionPattern getFunctionResultType() const;
10021002

1003-
/// Given that the value being abstracted is a function, return the
1004-
/// abstraction pattern for its input type.
1005-
AbstractionPattern getFunctionInputType() const;
1006-
10071003
/// Given that the value being abstracted is a function type, return
10081004
/// the abstraction pattern for one of its parameter types.
10091005
AbstractionPattern getFunctionParamType(unsigned index) const;

lib/SIL/AbstractionPattern.cpp

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -552,72 +552,6 @@ AbstractionPattern AbstractionPattern::getFunctionResultType() const {
552552
llvm_unreachable("bad kind");
553553
}
554554

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-
621555
AbstractionPattern
622556
AbstractionPattern::getFunctionParamType(unsigned index) const {
623557
switch (getKind()) {

0 commit comments

Comments
 (0)