@@ -967,23 +967,27 @@ class TypeConverter {
967
967
enum class ABIDifference : uint8_t {
968
968
// Types have compatible calling conventions and representations, so can
969
969
// be trivially bitcast.
970
+ //
971
+ // Furthermore, if two function types have
972
+ // arguments of function type that differ only in
973
+ // `CompatibleRepresentation`, those outer function types are transitively
974
+ // `CompatibleRepresentation`. (In all other cases, the outer function types
975
+ // would fall into the `NeedsThunk` case, because a thunk would be needed
976
+ // to change the representation of the function argument.)
970
977
CompatibleRepresentation,
971
978
972
- // No convention differences, function can be cast via `convert_function`
973
- // without a thunk.
974
- //
975
- // There may still be a representation difference between values of the
976
- // compared function types. This means that, if two function types
977
- // have a matching argument or return of function type with
978
- // `SameCallingConvention`, then the outer function types may not themselves
979
- // have the `SameCallingConvention` because they need a thunk to convert
980
- // the inner function value representation.
979
+ // No convention differences, but there may still be a representation
980
+ // difference between values of the compared function types, such as a
981
+ // different ptrauth discriminator. The conversion can be performed by a
982
+ // `convert_function` instruction.
981
983
CompatibleCallingConvention,
982
984
983
- // Representation difference requires thin-to-thick conversion.
985
+ // Representation difference requires thin-to-thick conversion with a
986
+ // `thin_to_thick_function` conversion.
984
987
CompatibleRepresentation_ThinToThick,
985
- // Function types have the `SameCallingConvention` but additionally need
986
- // a thin-to-thick conversion.
988
+ // Function types have `CompatibleCallingConvention` but additionally need
989
+ // a thin-to-thick conversion, so a `convert_function` followed by a
990
+ // `thin_to_thick_function` sequence is necessary to convert.
987
991
CompatibleCallingConvention_ThinToThick,
988
992
989
993
// Non-trivial difference requires thunk.
0 commit comments