aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-12 16:08:04 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-12 16:08:04 +0000
commitd28a80d64616b66c91d28bb4c08ca2d8c594de4e (patch)
tree822daf1e7169d1af412fc37bcb7c504801b641c6 /lib/CodeGen/CGStmt.cpp
parentc8ba9614ca5469c3ae259e3ec09792f4b8969397 (diff)
Emit basic block for switch body; fixes PR2307.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index d804ee6665..7986b4a113 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -499,6 +499,9 @@ void CodeGenFunction::EmitSwitchStmt(const SwitchStmt &S) {
llvm::BasicBlock *NextBlock = llvm::BasicBlock::Create("after.sw");
SwitchInsn = Builder.CreateSwitch(CondV, NextBlock);
+ // Create basic block for body of switch
+ StartBlock("body.sw");
+
// All break statements jump to NextBlock. If BreakContinueStack is non empty
// then reuse last ContinueBlock.
llvm::BasicBlock *ContinueBlock = NULL;