summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-11-22 18:43:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-11-22 18:43:41 +0000
commitd38951acff28b72b0709370659121a0f74379704 (patch)
treea648d1120869903623aa7dd2cf9d908ea6518caa /clang/lib/Rewrite/Frontend
parenta74768a12a12889b73f0e24c566a0ef92a48dc31 (diff)
downloadbcm5719-llvm-d38951acff28b72b0709370659121a0f74379704.tar.gz
bcm5719-llvm-d38951acff28b72b0709370659121a0f74379704.zip
ObjectiveC modern translator. Fixes a translation bug
tranalation @protocol expression. // rdar://15517895 llvm-svn: 195480
Diffstat (limited to 'clang/lib/Rewrite/Frontend')
-rw-r--r--clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
index ae33ac816e3..a248675d771 100644
--- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
@@ -3733,12 +3733,9 @@ Stmt *RewriteModernObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
SC_Extern);
DeclRefExpr *DRE = new (Context) DeclRefExpr(VD, false, getProtocolType(),
VK_LValue, SourceLocation());
- Expr *DerefExpr = new (Context) UnaryOperator(DRE, UO_AddrOf,
- Context->getPointerType(DRE->getType()),
- VK_RValue, OK_Ordinary, SourceLocation());
- CastExpr *castExpr = NoTypeInfoCStyleCastExpr(Context, DerefExpr->getType(),
- CK_BitCast,
- DerefExpr);
+ CastExpr *castExpr =
+ NoTypeInfoCStyleCastExpr(
+ Context, Context->getPointerType(DRE->getType()), CK_BitCast, DRE);
ReplaceStmt(Exp, castExpr);
ProtocolExprDecls.insert(Exp->getProtocol()->getCanonicalDecl());
// delete Exp; leak for now, see RewritePropertyOrImplicitSetter() usage for more info.
OpenPOWER on IntegriCloud