mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Revert r112091, "Remap metadata attached to instructions when remapping
individual ...", which depends on r111922, which I am reverting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -147,21 +147,10 @@ Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) {
|
||||
/// current values into those specified by VMap.
|
||||
///
|
||||
void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap) {
|
||||
// Remap operands.
|
||||
for (User::op_iterator op = I->op_begin(), E = I->op_end(); op != E; ++op) {
|
||||
Value *V = MapValue(*op, VMap);
|
||||
assert(V && "Referenced value not in value map!");
|
||||
*op = V;
|
||||
}
|
||||
|
||||
// Remap attached metadata.
|
||||
SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
|
||||
I->getAllMetadata(MDs);
|
||||
for (SmallVectorImpl<std::pair<unsigned, MDNode *> >::iterator
|
||||
MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) {
|
||||
Value *Old = MI->second;
|
||||
Value *New = MapValue(Old, VMap);
|
||||
if (New != Old)
|
||||
I->setMetadata(MI->first, cast<MDNode>(New));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user