Don't "optimize" empty or unit compound exprs away.

llvm-svn: 39467
This commit is contained in:
Chris Lattner 2007-05-20 22:47:04 +00:00
parent 30d1fbc803
commit 3bbe7bed39
2 changed files with 2 additions and 12 deletions

View File

@ -23,12 +23,7 @@ using namespace clang;
Action::StmtResult
Sema::ParseCompoundStmt(SourceLocation L, SourceLocation R,
StmtTy **Elts, unsigned NumElts) {
if (NumElts > 1)
return new CompoundStmt((Stmt**)Elts, NumElts);
else if (NumElts == 1)
return Elts[0]; // {stmt} -> stmt
else
return 0; // {} -> ;
return new CompoundStmt((Stmt**)Elts, NumElts);
}
Action::StmtResult

View File

@ -23,12 +23,7 @@ using namespace clang;
Action::StmtResult
Sema::ParseCompoundStmt(SourceLocation L, SourceLocation R,
StmtTy **Elts, unsigned NumElts) {
if (NumElts > 1)
return new CompoundStmt((Stmt**)Elts, NumElts);
else if (NumElts == 1)
return Elts[0]; // {stmt} -> stmt
else
return 0; // {} -> ;
return new CompoundStmt((Stmt**)Elts, NumElts);
}
Action::StmtResult