summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 1f21ee0ec57..920457e00c6 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -149,14 +149,10 @@ Sema::ExprResult Sema::ActOnClassMessage(
return Diag(lbrac, diag::error_no_super_class,
CurMethodDecl->getClassInterface()->getName());
if (CurMethodDecl->isInstance()) {
- // Synthesize a cast to the super class. This hack allows us to loosely
- // represent super without creating a special expression node.
- IdentifierInfo &II = Context.Idents.get("self");
- ExprResult ReceiverExpr = ActOnIdentifierExpr(S, lbrac, II, false);
QualType superTy = Context.getObjCInterfaceType(ClassDecl);
superTy = Context.getPointerType(superTy);
- ReceiverExpr = ActOnCastExpr(SourceLocation(), superTy.getAsOpaquePtr(),
- SourceLocation(), ReceiverExpr.Val);
+ ExprResult ReceiverExpr = new PreDefinedExpr(SourceLocation(), superTy,
+ PreDefinedExpr::ObjCSuper);
// We are really in an instance method, redirect.
return ActOnInstanceMessage(ReceiverExpr.Val, Sel, lbrac, rbrac,
Args, NumArgs);
OpenPOWER on IntegriCloud