Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52580 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 1f21ee0..920457e 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -149,14 +149,10 @@
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);