summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index d804ee6665f..7986b4a1132 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud