[cfe-commits] r56762 - /cfe/trunk/lib/CodeGen/CGStmt.cpp

Daniel Dunbar daniel at zuster.org
Sat Sep 27 17:19:22 PDT 2008


Author: ddunbar
Date: Sat Sep 27 19:19:22 2008
New Revision: 56762

URL: http://llvm.org/viewvc/llvm-project?rev=56762&view=rev
Log:
Skip redundant if.

Modified:
    cfe/trunk/lib/CodeGen/CGStmt.cpp

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=56762&r1=56761&r2=56762&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Sat Sep 27 19:19:22 2008
@@ -385,12 +385,11 @@
 
   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 @@
 /// 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());





More information about the cfe-commits mailing list