Runtime: Check for SpecialProtocol::AnyObject instead of strcmp'ing the mangled protocol name.

Swift SVN r26500
This commit is contained in:
Joe Groff
2015-03-24 21:48:08 +00:00
parent b60cf1efd4
commit 8571b4f6a9

View File

@@ -463,7 +463,7 @@ static bool _conformsToProtocol(const OpaqueValue *value,
const WitnessTable **conformance) {
// Handle AnyObject directly.
// FIXME: strcmp here is horribly slow.
if (strcmp(protocol->Name, "_TtPSs9AnyObject_") == 0) {
if (protocol->Flags.getSpecialProtocol() == SpecialProtocol::AnyObject) {
switch (type->getKind()) {
case MetadataKind::Class:
case MetadataKind::ObjCClassWrapper: