[cfe-commits] r71989 - in /cfe/trunk: include/clang/Parse/Action.h lib/AST/Expr.cpp lib/Parse/ParseObjc.cpp lib/Parse/ParseStmt.cpp lib/Sema/Sema.h lib/Sema/SemaStmt.cpp tools/clang-cc/PrintParserCallbacks.cpp
Anders Carlsson
andersca at mac.com
Sun May 17 14:11:32 PDT 2009
Author: andersca
Date: Sun May 17 16:11:30 2009
New Revision: 71989
URL: http://llvm.org/viewvc/llvm-project?rev=71989&view=rev
Log:
Make ActOnExprStmt take a FullExprArg.
Modified:
cfe/trunk/include/clang/Parse/Action.h
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/tools/clang-cc/PrintParserCallbacks.cpp
Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Sun May 17 16:11:30 2009
@@ -460,8 +460,8 @@
return StmtEmpty();
}
- virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
- return OwningStmtResult(*this, Expr.release());
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
+ return OwningStmtResult(*this, Expr->release());
}
/// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Sun May 17 16:11:30 2009
@@ -594,6 +594,9 @@
// effects (e.g. a placement new with an uninitialized POD).
case CXXDeleteExprClass:
return false;
+ case CXXExprWithTemporariesClass:
+ return cast<CXXExprWithTemporaries>(this)
+ ->getSubExpr()->isUnusedResultAWarning(Loc, R1, R2);
}
}
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Sun May 17 16:11:30 2009
@@ -1408,7 +1408,7 @@
}
// Otherwise, eat the semicolon.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- return Actions.ActOnExprStmt(move(Res));
+ return Actions.ActOnExprStmt(Actions.FullExpr(Res));
}
Parser::OwningExprResult Parser::ParseObjCAtExpression(SourceLocation AtLoc) {
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Sun May 17 16:11:30 2009
@@ -121,7 +121,7 @@
}
// Otherwise, eat the semicolon.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- return Actions.ActOnExprStmt(move(Expr));
+ return Actions.ActOnExprStmt(Actions.FullExpr(Expr));
}
case tok::kw_case: // C99 6.8.1: labeled-statement
@@ -457,7 +457,7 @@
// Eat the semicolon at the end of stmt and convert the expr into a
// statement.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- R = Actions.ActOnExprStmt(move(Res));
+ R = Actions.ActOnExprStmt(Actions.FullExpr(Res));
}
}
@@ -929,7 +929,7 @@
// Turn the expression into a stmt.
if (!Value.isInvalid())
- FirstPart = Actions.ActOnExprStmt(move(Value));
+ FirstPart = Actions.ActOnExprStmt(Actions.FullExpr(Value));
if (Tok.is(tok::semi)) {
ConsumeToken();
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sun May 17 16:11:30 2009
@@ -1155,7 +1155,7 @@
//===--------------------------------------------------------------------===//
// Statement Parsing Callbacks: SemaStmt.cpp.
public:
- virtual OwningStmtResult ActOnExprStmt(ExprArg Expr);
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr);
virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc);
virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L, SourceLocation R,
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Sun May 17 16:11:30 2009
@@ -21,8 +21,8 @@
#include "clang/Basic/TargetInfo.h"
using namespace clang;
-Sema::OwningStmtResult Sema::ActOnExprStmt(ExprArg expr) {
- Expr *E = expr.takeAs<Expr>();
+Sema::OwningStmtResult Sema::ActOnExprStmt(FullExprArg expr) {
+ Expr *E = expr->takeAs<Expr>();
assert(E && "ActOnExprStmt(): missing expression");
// C99 6.8.3p2: The expression in an expression statement is evaluated as a
Modified: cfe/trunk/tools/clang-cc/PrintParserCallbacks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/PrintParserCallbacks.cpp?rev=71989&r1=71988&r2=71989&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/PrintParserCallbacks.cpp (original)
+++ cfe/trunk/tools/clang-cc/PrintParserCallbacks.cpp Sun May 17 16:11:30 2009
@@ -266,9 +266,9 @@
return StmtEmpty();
}
- virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
llvm::cout << __FUNCTION__ << "\n";
- return OwningStmtResult(*this, Expr.release());
+ return OwningStmtResult(*this, Expr->release());
}
/// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
More information about the cfe-commits
mailing list