diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-01 18:09:12 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-01 18:09:12 +0000 |
commit | 3fc73ee0c613715ebce78e30b4d050ea715a007d (patch) | |
tree | 184c52328fd14fff87e4dfde974b6477f5d367e9 /lib/Rewrite/RewriteObjC.cpp | |
parent | 71cb8a2e10c3f75ca50e2b4f205cbd4cec40ad5e (diff) |
Use declaresSameEntity() when comparing ObjCProtocolDecls, and
getCanonicalDecl() when putting ObjCProtocolDecls into a set. This is
groundwork for making ObjCProtocolDecl redeclarable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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"); } |