forked from OSchip/llvm-project
parent
c2cb34ae61
commit
87dc093b10
|
@ -383,12 +383,6 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
|
|||
ThrowException("Redefinition of label " + ID.getName());
|
||||
|
||||
ID.destroy(); // Free strdup'd memory.
|
||||
|
||||
// Make sure to move the basic block to the correct location in the
|
||||
// function, instead of leaving it inserted wherever it was first
|
||||
// referenced.
|
||||
CurFun.CurrentFunction->getBasicBlockList().remove(BB);
|
||||
CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
|
||||
return BB;
|
||||
}
|
||||
|
||||
|
@ -1685,9 +1679,21 @@ InstructionList : InstructionList Inst {
|
|||
}
|
||||
| /* empty */ {
|
||||
$$ = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
|
||||
|
||||
// Make sure to move the basic block to the correct location in the
|
||||
// function, instead of leaving it inserted wherever it was first
|
||||
// referenced.
|
||||
CurFun.CurrentFunction->getBasicBlockList().remove(CurBB);
|
||||
CurFun.CurrentFunction->getBasicBlockList().push_back(CurBB);
|
||||
}
|
||||
| LABELSTR {
|
||||
$$ = CurBB = getBBVal(ValID::create($1), true);
|
||||
|
||||
// Make sure to move the basic block to the correct location in the
|
||||
// function, instead of leaving it inserted wherever it was first
|
||||
// referenced.
|
||||
CurFun.CurrentFunction->getBasicBlockList().remove(CurBB);
|
||||
CurFun.CurrentFunction->getBasicBlockList().push_back(CurBB);
|
||||
};
|
||||
|
||||
BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
||||
|
|
Loading…
Reference in New Issue