mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[devirt] Disable devirt of inherited protocol conformances for Seed 5.
Devirtualization of inherited protocol conformances are not essential for stdlib performance since in most cases the stdlib does not use class types (in contrast to devirtualization of specialized protocol conformances which /is/ essential). So for Seed 5 I am disabling this for the reasons below: We are not upcasting metatypes correctly and while debugging that I ran into a case where in the protocol witness we had generic types as if the protocol witness was potentially covariant in all arguments. This caused the devirtualizer to subtitute in the witness type as appropriate, but due to the covariant argument the devirtualizer did not perform an upcast causing a verifier fail. <rdar://problem/17823711> Swift SVN r20612
This commit is contained in:
@@ -339,9 +339,14 @@ bool WitnessMethodDevirtualizer::devirtualize() {
|
||||
/// If we dont and do not have any substitutions, we must then have a pure
|
||||
/// inherited protocol conformance.
|
||||
if (Subs.empty()) {
|
||||
#if 1
|
||||
// Disable inherited protocol conformance for seed 5.
|
||||
return false;
|
||||
#else
|
||||
assert(isa<InheritedProtocolConformance>(C) &&
|
||||
"At this point C must be an inherited protocol conformance.");
|
||||
return processInheritedProtocolConformance();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// If we have substitutions, we must have some sort of specialized protocol
|
||||
|
||||
Reference in New Issue
Block a user