]> granicus.if.org Git - clang/commitdiff
Skip redundant if.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 28 Sep 2008 00:19:22 +0000 (00:19 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 28 Sep 2008 00:19:22 +0000 (00:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56762 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp

index c7ee22a2c33b98f086880bd433b8553426092939..eb9dac1569a13eb8f9416361e8e3b99e1b231537 100644 (file)
@@ -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());