From a0ab25d2808fe77ffff54f25a015893791dfd4b6 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 30 May 2009 21:42:34 +0000 Subject: [PATCH] ActOnReturnStmt should also take a FullExprArg. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72641 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Parse/Action.h | 2 +- lib/Frontend/PrintParserCallbacks.cpp | 2 +- lib/Parse/ParseStmt.cpp | 2 +- lib/Sema/Sema.h | 2 +- lib/Sema/SemaStmt.cpp | 4 ++-- lib/Sema/SemaTemplateInstantiateStmt.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 2ef87be13b..5c23f9ac61 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -551,7 +551,7 @@ public: return StmtEmpty(); } virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, - ExprArg RetValExp) { + FullExprArg RetValExp) { return StmtEmpty(); } virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc, diff --git a/lib/Frontend/PrintParserCallbacks.cpp b/lib/Frontend/PrintParserCallbacks.cpp index fbac3c88aa..f02d5d469c 100644 --- a/lib/Frontend/PrintParserCallbacks.cpp +++ b/lib/Frontend/PrintParserCallbacks.cpp @@ -369,7 +369,7 @@ namespace { return StmtEmpty(); } virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, - ExprArg RetValExp) { + FullExprArg RetValExp) { Out << __FUNCTION__ << "\n"; return StmtEmpty(); } diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 952c4c15f3..758b662a23 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -1071,7 +1071,7 @@ Parser::OwningStmtResult Parser::ParseReturnStatement() { return StmtError(); } } - return Actions.ActOnReturnStmt(ReturnLoc, move(R)); + return Actions.ActOnReturnStmt(ReturnLoc, Actions.FullExpr(R)); } /// FuzzyParseMicrosoftAsmStatement. When -fms-extensions is enabled, this diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 9939781667..b2540ba2e0 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -1215,7 +1215,7 @@ public: Scope *CurScope); virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, - ExprArg RetValExp); + FullExprArg RetValExp); OwningStmtResult ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp); diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 1a1362e669..879d84e36c 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -826,8 +826,8 @@ static bool IsReturnCopyElidable(ASTContext &Ctx, QualType RetType, } Action::OwningStmtResult -Sema::ActOnReturnStmt(SourceLocation ReturnLoc, ExprArg rex) { - Expr *RetValExp = rex.takeAs(); +Sema::ActOnReturnStmt(SourceLocation ReturnLoc, FullExprArg rex) { + Expr *RetValExp = rex->takeAs(); if (CurBlock) return ActOnBlockReturnStmt(ReturnLoc, RetValExp); diff --git a/lib/Sema/SemaTemplateInstantiateStmt.cpp b/lib/Sema/SemaTemplateInstantiateStmt.cpp index 91807c3e6a..1f69479a0e 100644 --- a/lib/Sema/SemaTemplateInstantiateStmt.cpp +++ b/lib/Sema/SemaTemplateInstantiateStmt.cpp @@ -130,7 +130,7 @@ TemplateStmtInstantiator::VisitReturnStmt(ReturnStmt *S) { return SemaRef.StmtError(); } - return SemaRef.ActOnReturnStmt(S->getReturnLoc(), move(Result)); + return SemaRef.ActOnReturnStmt(S->getReturnLoc(), FullExpr(Result)); } Sema::OwningStmtResult -- 2.40.0