Author: fjahanian
Date: Tue Jan 17 17:55:19 2012
New Revision: 148361
URL: http://llvm.org/viewvc/llvm-project?rev=148361&view=rev
Log:
output body of folded case again.
Modified:
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/test/CodeGenCXX/switch-case-folding-2.cpp
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=148361&r1=148360&r2=148361&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Tue Jan 17 17:55:19 2012
@@ -883,8 +883,10 @@
// when we've constant-folded the switch, are emitting the constant case,
// and part of the constant case includes another case statement. For
// instance: switch (4) { case 4: do { case 5: } while (1); }
- if (!SwitchInsn)
+ if (!SwitchInsn) {
+ EmitStmt(S.getSubStmt());
return;
+ }
// Handle case ranges.
if (S.getRHS()) {
Modified: cfe/trunk/test/CodeGenCXX/switch-case-folding-2.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/switch-case-folding-2.cpp?rev=148361&r1=148360&r2=148361&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/switch-case-folding-2.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/switch-case-folding-2.cpp Tue Jan 17 17:55:19 2012
@@ -18,4 +18,4 @@
return test(5);
}
-// CHECK-NOT: call i32 (i8*, ...)* @printf(
+// CHECK: call i32 (i8*, ...)* @_Z6printfPKcz
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits