diff options
author | Chris Lattner <sabre@nondot.org> | 2008-06-21 18:04:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-06-21 18:04:54 +0000 |
commit | a9b3cae8fda062142d0044b38359241a17081e2a (patch) | |
tree | 1466e0cabe9a783730f7cf0efd307badc800cce1 /clang/lib/Sema/SemaExprObjC.cpp | |
parent | 552b52f49dceb71a73676ce65b3add81141f583f (diff) | |
download | bcm5719-llvm-a9b3cae8fda062142d0044b38359241a17081e2a.tar.gz bcm5719-llvm-a9b3cae8fda062142d0044b38359241a17081e2a.zip |
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.
llvm-svn: 52580
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 8 |
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); |