mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Fix bug in previous patch :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15226 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -383,12 +383,6 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
|
|||||||
ThrowException("Redefinition of label " + ID.getName());
|
ThrowException("Redefinition of label " + ID.getName());
|
||||||
|
|
||||||
ID.destroy(); // Free strdup'd memory.
|
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;
|
return BB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1685,9 +1679,21 @@ InstructionList : InstructionList Inst {
|
|||||||
}
|
}
|
||||||
| /* empty */ {
|
| /* empty */ {
|
||||||
$$ = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
|
$$ = 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 {
|
| LABELSTR {
|
||||||
$$ = CurBB = getBBVal(ValID::create($1), true);
|
$$ = 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...
|
BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
||||||
|
Reference in New Issue
Block a user