mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Fix the last of the silly bugs I just introduced. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -240,7 +240,7 @@ bool ADCE::doADCE() {
|
|||||||
//
|
//
|
||||||
if (!AliveBlocks.count(&Func->front())) {
|
if (!AliveBlocks.count(&Func->front())) {
|
||||||
BasicBlock *NewEntry = new BasicBlock();
|
BasicBlock *NewEntry = new BasicBlock();
|
||||||
new BranchInst(&Func->front(), NewEntry->end());
|
NewEntry->getInstList().push_back(new BranchInst(&Func->front()));
|
||||||
Func->getBasicBlockList().push_front(NewEntry);
|
Func->getBasicBlockList().push_front(NewEntry);
|
||||||
AliveBlocks.insert(NewEntry); // This block is always alive!
|
AliveBlocks.insert(NewEntry); // This block is always alive!
|
||||||
}
|
}
|
||||||
@@ -353,8 +353,8 @@ bool ADCE::doADCE() {
|
|||||||
// Delete the old terminator instruction...
|
// Delete the old terminator instruction...
|
||||||
BB->getInstList().pop_back();
|
BB->getInstList().pop_back();
|
||||||
const Type *RetTy = Func->getReturnType();
|
const Type *RetTy = Func->getReturnType();
|
||||||
new ReturnInst(RetTy != Type::VoidTy ? Constant::getNullValue(RetTy) :0,
|
BB->getInstList().push_back(new ReturnInst(RetTy != Type::VoidTy ?
|
||||||
BB->end());
|
Constant::getNullValue(RetTy) : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
BB->dropAllReferences();
|
BB->dropAllReferences();
|
||||||
|
Reference in New Issue
Block a user