[cfe-commits] r103198 - in /cfe/trunk: include/clang/Parse/Ownership.h lib/Parse/ParseStmt.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaStmt.cpp lib/Sema/TreeTransform.h
Douglas Gregor
dgregor at apple.com
Thu May 6 14:39:56 PDT 2010
Author: dgregor
Date: Thu May 6 16:39:56 2010
New Revision: 103198
URL: http://llvm.org/viewvc/llvm-project?rev=103198&view=rev
Log:
Fixed DISABLE_SMART_POINTERS breakage
Modified:
cfe/trunk/include/clang/Parse/Ownership.h
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/include/clang/Parse/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Ownership.h?rev=103198&r1=103197&r2=103198&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Ownership.h (original)
+++ cfe/trunk/include/clang/Parse/Ownership.h Thu May 6 16:39:56 2010
@@ -166,7 +166,7 @@
// conversions.
// Flip this switch to measure performance impact of the smart pointers.
-//#define DISABLE_SMART_POINTERS
+// #define DISABLE_SMART_POINTERS
namespace llvm {
template<>
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=103198&r1=103197&r2=103198&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Thu May 6 16:39:56 2010
@@ -989,6 +989,7 @@
bool ForEach = false;
OwningStmtResult FirstPart(Actions);
+ bool SecondPartIsInvalid = false;
FullExprArg SecondPart(Actions);
OwningExprResult Collection(Actions);
FullExprArg ThirdPart(Actions);
@@ -1062,13 +1063,14 @@
Second = Actions.ActOnBooleanCondition(CurScope, ForLoc,
move(Second));
}
+ SecondPartIsInvalid = Second.isInvalid();
SecondPart = Actions.MakeFullExpr(Second);
}
if (Tok.is(tok::semi)) {
ConsumeToken();
} else {
- if (!SecondPart->isInvalid() || SecondVar.get())
+ if (!SecondPartIsInvalid || SecondVar.get())
Diag(Tok, diag::err_expected_semi_for);
SkipUntil(tok::semi);
}
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=103198&r1=103197&r2=103198&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu May 6 16:39:56 2010
@@ -7697,10 +7697,10 @@
Sema::OwningExprResult Sema::ActOnBooleanCondition(Scope *S, SourceLocation Loc,
ExprArg SubExpr) {
- if (SubExpr.isInvalid())
+ Expr *Sub = SubExpr.takeAs<Expr>();
+ if (!Sub)
return ExprError();
- Expr *Sub = SubExpr.takeAs<Expr>();
if (CheckBooleanCondition(Sub, Loc)) {
Sub->Destroy(Context);
return ExprError();
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=103198&r1=103197&r2=103198&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu May 6 16:39:56 2010
@@ -2949,12 +2949,11 @@
}
Sema::OwningExprResult Sema::ActOnFinishFullExpr(ExprArg Arg) {
- if (Arg.isInvalid())
- return ExprError();
-
Expr *FullExpr = Arg.takeAs<Expr>();
if (FullExpr)
FullExpr = MaybeCreateCXXExprWithTemporaries(FullExpr);
-
+ else
+ return ExprError();
+
return Owned(FullExpr);
}
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=103198&r1=103197&r2=103198&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu May 6 16:39:56 2010
@@ -524,9 +524,11 @@
VarDecl *ConditionVar = 0;
if (CondVar.get()) {
ConditionVar = CondVar.getAs<VarDecl>();
- Cond = CheckConditionVariable(ConditionVar, SourceLocation(), false);
- if (Cond.isInvalid())
+ OwningExprResult CondE = CheckConditionVariable(ConditionVar, SourceLocation(), false);
+ if (CondE.isInvalid())
return StmtError();
+
+ Cond = move(CondE);
}
Expr *CondExpr = Cond.takeAs<Expr>();
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=103198&r1=103197&r2=103198&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Thu May 6 16:39:56 2010
@@ -763,9 +763,12 @@
SourceLocation ElseLoc, StmtArg Else) {
if (Cond.get()) {
// Convert the condition to a boolean value.
- Cond = getSema().ActOnBooleanCondition(0, IfLoc, move(Cond));
- if (Cond.isInvalid())
+ OwningExprResult CondE = getSema().ActOnBooleanCondition(0, IfLoc,
+ move(Cond));
+ if (CondE.isInvalid())
return getSema().StmtError();
+
+ Cond = move(CondE);
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
@@ -804,9 +807,11 @@
StmtArg Body) {
if (Cond.get()) {
// Convert the condition to a boolean value.
- Cond = getSema().ActOnBooleanCondition(0, WhileLoc, move(Cond));
- if (Cond.isInvalid())
+ OwningExprResult CondE = getSema().ActOnBooleanCondition(0, WhileLoc,
+ move(Cond));
+ if (CondE.isInvalid())
return getSema().StmtError();
+ Cond = move(CondE);
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
@@ -838,9 +843,12 @@
SourceLocation RParenLoc, StmtArg Body) {
if (Cond.get()) {
// Convert the condition to a boolean value.
- Cond = getSema().ActOnBooleanCondition(0, ForLoc, move(Cond));
- if (Cond.isInvalid())
+ OwningExprResult CondE = getSema().ActOnBooleanCondition(0, ForLoc,
+ move(Cond));
+ if (CondE.isInvalid())
return getSema().StmtError();
+
+ Cond = move(CondE);
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
More information about the cfe-commits
mailing list