aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-09-28 00:19:22 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-09-28 00:19:22 +0000
commitad12b6d643aba6c36f5cec4c9beb4977a12eace4 (patch)
tree5be26afbdd423283adb340da3b9025aab7d2079b /lib/CodeGen/CGStmt.cpp
parent538afe30e4f9bfb338171be859d584e201dca2df (diff)
Skip redundant if.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index c7ee22a2c3..eb9dac1569 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/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());