[cfe-commits] r39467 - in /cfe/cfe/trunk: AST/SemaStmt.cpp Sema/SemaStmt.cpp
clattner at cs.uiuc.edu
clattner at cs.uiuc.edu
Wed Jul 11 09:44:43 PDT 2007
Author: clattner
Date: Wed Jul 11 11:44:43 2007
New Revision: 39467
URL: http://llvm.org/viewvc/llvm-project?rev=39467&view=rev
Log:
Don't "optimize" empty or unit compound exprs away.
Modified:
cfe/cfe/trunk/AST/SemaStmt.cpp
cfe/cfe/trunk/Sema/SemaStmt.cpp
Modified: cfe/cfe/trunk/AST/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaStmt.cpp?rev=39467&r1=39466&r2=39467&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/SemaStmt.cpp (original)
+++ cfe/cfe/trunk/AST/SemaStmt.cpp Wed Jul 11 11:44:43 2007
@@ -23,12 +23,7 @@
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
Modified: cfe/cfe/trunk/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaStmt.cpp?rev=39467&r1=39466&r2=39467&view=diff
==============================================================================
--- cfe/cfe/trunk/Sema/SemaStmt.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaStmt.cpp Wed Jul 11 11:44:43 2007
@@ -23,12 +23,7 @@
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
More information about the cfe-commits
mailing list