summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/RewriteObjC.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-01 18:09:12 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-01 18:09:12 +0000
commit33b2429bf329c2bd39cf3b9612ae10fb28895539 (patch)
tree0456f77049e687e6c35f5ed224cffa69a2eaaf41 /clang/lib/Rewrite/RewriteObjC.cpp
parent0f960a0a5ada98d0ada8562dbd7c16b22a77091a (diff)
downloadbcm5719-llvm-33b2429bf329c2bd39cf3b9612ae10fb28895539.tar.gz
bcm5719-llvm-33b2429bf329c2bd39cf3b9612ae10fb28895539.zip
Use declaresSameEntity() when comparing ObjCProtocolDecls, and
getCanonicalDecl() when putting ObjCProtocolDecls into a set. This is groundwork for making ObjCProtocolDecl redeclarable. llvm-svn: 147406
Diffstat (limited to 'clang/lib/Rewrite/RewriteObjC.cpp')
-rw-r--r--clang/lib/Rewrite/RewriteObjC.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Rewrite/RewriteObjC.cpp b/clang/lib/Rewrite/RewriteObjC.cpp
index 4b41e5a4450..1b39061d50b 100644
--- a/clang/lib/Rewrite/RewriteObjC.cpp
+++ b/clang/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");
}
OpenPOWER on IntegriCloud