mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74676 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -935,9 +935,11 @@ bool JumpThreading::ThreadEdge(BasicBlock *BB, BasicBlock *PredBB,
|
||||
|
||||
// Remap operands to patch up intra-block references.
|
||||
for (unsigned i = 0, e = New->getNumOperands(); i != e; ++i)
|
||||
if (Instruction *Inst = dyn_cast<Instruction>(New->getOperand(i)))
|
||||
if (Value *Remapped = ValueMapping[Inst])
|
||||
New->setOperand(i, Remapped);
|
||||
if (Instruction *Inst = dyn_cast<Instruction>(New->getOperand(i))) {
|
||||
DenseMap<Instruction*, Value*>::iterator I = ValueMapping.find(Inst);
|
||||
if (I != ValueMapping.end())
|
||||
New->setOperand(i, I->second);
|
||||
}
|
||||
}
|
||||
|
||||
// We didn't copy the terminator from BB over to NewBB, because there is now
|
||||
@ -953,9 +955,11 @@ bool JumpThreading::ThreadEdge(BasicBlock *BB, BasicBlock *PredBB,
|
||||
Value *IV = PN->getIncomingValueForBlock(BB);
|
||||
|
||||
// Remap the value if necessary.
|
||||
if (Instruction *Inst = dyn_cast<Instruction>(IV))
|
||||
if (Value *MappedIV = ValueMapping[Inst])
|
||||
IV = MappedIV;
|
||||
if (Instruction *Inst = dyn_cast<Instruction>(IV)) {
|
||||
DenseMap<Instruction*, Value*>::iterator I = ValueMapping.find(Inst);
|
||||
if (I != ValueMapping.end())
|
||||
IV = I->second;
|
||||
}
|
||||
PN->addIncoming(IV, NewBB);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user