diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ASTContext.cpp | 10 | ||||
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 9784191ad8..a990989b20 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1195,10 +1195,10 @@ void ASTContext::CollectInheritedProtocols(const Decl *CDecl, for (ObjCInterfaceDecl::all_protocol_iterator P = OI->all_referenced_protocol_begin(), PE = OI->all_referenced_protocol_end(); P != PE; ++P) { ObjCProtocolDecl *Proto = (*P); - Protocols.insert(Proto); + Protocols.insert(Proto->getCanonicalDecl()); for (ObjCProtocolDecl::protocol_iterator P = Proto->protocol_begin(), PE = Proto->protocol_end(); P != PE; ++P) { - Protocols.insert(*P); + Protocols.insert((*P)->getCanonicalDecl()); CollectInheritedProtocols(*P, Protocols); } } @@ -1216,7 +1216,7 @@ void ASTContext::CollectInheritedProtocols(const Decl *CDecl, for (ObjCCategoryDecl::protocol_iterator P = OC->protocol_begin(), PE = OC->protocol_end(); P != PE; ++P) { ObjCProtocolDecl *Proto = (*P); - Protocols.insert(Proto); + Protocols.insert(Proto->getCanonicalDecl()); for (ObjCProtocolDecl::protocol_iterator P = Proto->protocol_begin(), PE = Proto->protocol_end(); P != PE; ++P) CollectInheritedProtocols(*P, Protocols); @@ -1225,7 +1225,7 @@ void ASTContext::CollectInheritedProtocols(const Decl *CDecl, for (ObjCProtocolDecl::protocol_iterator P = OP->protocol_begin(), PE = OP->protocol_end(); P != PE; ++P) { ObjCProtocolDecl *Proto = (*P); - Protocols.insert(Proto); + Protocols.insert(Proto->getCanonicalDecl()); for (ObjCProtocolDecl::protocol_iterator P = Proto->protocol_begin(), PE = Proto->protocol_end(); P != PE; ++P) CollectInheritedProtocols(*P, Protocols); @@ -5178,7 +5178,7 @@ bool ASTContext::areCompatibleVectorTypes(QualType FirstVec, bool ASTContext::ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const { - if (lProto == rProto) + if (declaresSameEntity(lProto, rProto)) return true; for (ObjCProtocolDecl::protocol_iterator PI = rProto->protocol_begin(), E = rProto->protocol_end(); PI != E; ++PI) diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 4b41e5a445..1b39061d50 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -3085,7 +3085,7 @@ Stmt *RewriteObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) { CK_BitCast, DerefExpr); ReplaceStmt(Exp, castExpr); - ProtocolExprDecls.insert(Exp->getProtocol()); + ProtocolExprDecls.insert(Exp->getProtocol()->getCanonicalDecl()); // delete Exp; leak for now, see RewritePropertyOrImplicitSetter() usage for more info. return castExpr; @@ -5185,7 +5185,7 @@ void RewriteObjCFragileABI::RewriteObjCProtocolMetaData( objc_protocol_methods = true; } // Do not synthesize the protocol more than once. - if (ObjCSynthesizedProtocols.count(PDecl)) + if (ObjCSynthesizedProtocols.count(PDecl->getCanonicalDecl())) return; if (PDecl->instmeth_begin() != PDecl->instmeth_end()) { @@ -5307,7 +5307,7 @@ void RewriteObjCFragileABI::RewriteObjCProtocolMetaData( Result += "};\n"; // Mark this protocol as having been generated. - if (!ObjCSynthesizedProtocols.insert(PDecl)) + if (!ObjCSynthesizedProtocols.insert(PDecl->getCanonicalDecl())) llvm_unreachable("protocol already synthesized"); } |