forked from OSchip/llvm-project
Emit basic block for switch body; fixes PR2307.
llvm-svn: 50968
This commit is contained in:
parent
ecb77385ab
commit
6a7087e455
|
@ -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;
|
||||
|
|
|
@ -74,3 +74,14 @@ void foo5(){
|
|||
}
|
||||
}
|
||||
|
||||
void foo6(){
|
||||
switch(0){
|
||||
}
|
||||
}
|
||||
|
||||
void foo7(){
|
||||
switch(0){
|
||||
foo7();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue