diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2008-09-28 00:19:22 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-28 00:19:22 +0000 |
| commit | a2d3570fc979b3534ecbc85b4401fd3f2dde901d (patch) | |
| tree | 1d61885bcf89cee6a1a93c464b17fc36a0e0f297 /clang/lib/CodeGen | |
| parent | edec9ba58dd7f5bdbc9e9307801f9c39c94c44c1 (diff) | |
| download | bcm5719-llvm-a2d3570fc979b3534ecbc85b4401fd3f2dde901d.tar.gz bcm5719-llvm-a2d3570fc979b3534ecbc85b4401fd3f2dde901d.zip | |
Skip redundant if.
llvm-svn: 56762
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index c7ee22a2c33..eb9dac1569a 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -385,12 +385,11 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S) { BreakContinueStack.pop_back(); - if (S.getInc()) - EmitBlock(ContinueBlock); - // If there is an increment, emit it next. - if (S.getInc()) + if (S.getInc()) { + EmitBlock(ContinueBlock); EmitStmt(S.getInc()); + } // Finally, branch back up to the condition for the next iteration. Builder.CreateBr(CondBlock); @@ -471,7 +470,6 @@ void CodeGenFunction::EmitContinueStmt() { /// add multiple cases to switch instruction, one for each value within /// the range. If range is too big then emit "if" condition check. void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) { - // FIXME: kill me with param - ddunbar assert(S.getRHS() && "Expected RHS value in CaseStmt"); llvm::APSInt LHS = S.getLHS()->getIntegerConstantExprValue(getContext()); |

