mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
* Check in fix for: llvm/test/Regression/Other/2002-02-14-LevelRaiseInstDelete.ll
* Minor reformatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -357,6 +357,10 @@ Value *ConvertExpressionToType(Value *V, const Type *Ty, ValueMapCache &VMC) {
|
|||||||
ValueMapCache::ExprMapTy::iterator VMCI = VMC.ExprMap.find(V);
|
ValueMapCache::ExprMapTy::iterator VMCI = VMC.ExprMap.find(V);
|
||||||
if (VMCI != VMC.ExprMap.end()) {
|
if (VMCI != VMC.ExprMap.end()) {
|
||||||
assert(VMCI->second->getType() == Ty);
|
assert(VMCI->second->getType() == Ty);
|
||||||
|
|
||||||
|
if (Instruction *I = dyn_cast<Instruction>(V))
|
||||||
|
ValueHandle IHandle(VMC, I); // Remove I if it is unused now!
|
||||||
|
|
||||||
return VMCI->second;
|
return VMCI->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,12 +1088,10 @@ static void RecursiveDelete(ValueMapCache &Cache, Instruction *I) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (User::op_iterator OI = I->op_begin(), OE = I->op_end();
|
for (User::op_iterator OI = I->op_begin(), OE = I->op_end();
|
||||||
OI != OE; ++OI) {
|
OI != OE; ++OI)
|
||||||
Instruction *U = dyn_cast<Instruction>(*OI);
|
if (Instruction *U = dyn_cast<Instruction>(*OI)) {
|
||||||
if (U) {
|
|
||||||
*OI = 0;
|
*OI = 0;
|
||||||
RecursiveDelete(Cache, dyn_cast<Instruction>(U));
|
RecursiveDelete(Cache, U);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
I->getParent()->getInstList().remove(I);
|
I->getParent()->getInstList().remove(I);
|
||||||
|
Reference in New Issue
Block a user