Skip to content

Commit fdbcd12

Browse files
[NFC] Bridge based on SILFunctionLanguage instead of Representation.
1 parent eeec16f commit fdbcd12

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,18 +3988,13 @@ TypeConverter::getBridgedFunctionType(AbstractionPattern pattern,
39883988
// Pull out the generic signature.
39893989
CanGenericSignature genericSig = t.getOptGenericSignature();
39903990

3991-
switch (auto rep = t->getExtInfo().getSILRepresentation()) {
3992-
case SILFunctionTypeRepresentation::Thick:
3993-
case SILFunctionTypeRepresentation::Thin:
3994-
case SILFunctionTypeRepresentation::Method:
3995-
case SILFunctionTypeRepresentation::Closure:
3996-
case SILFunctionTypeRepresentation::WitnessMethod: {
3991+
auto rep = t->getExtInfo().getSILRepresentation();
3992+
switch (getSILFunctionLanguage(rep)) {
3993+
case SILFunctionLanguage::Swift: {
39973994
// No bridging needed for native functions.
39983995
return t;
39993996
}
4000-
case SILFunctionTypeRepresentation::CFunctionPointer:
4001-
case SILFunctionTypeRepresentation::Block:
4002-
case SILFunctionTypeRepresentation::ObjCMethod: {
3997+
case SILFunctionLanguage::C: {
40033998
SmallVector<AnyFunctionType::Param, 8> params;
40043999
getBridgedParams(rep, pattern, t->getParams(), params, bridging);
40054000

0 commit comments

Comments
 (0)