mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
IR: MDNode => Value: Instruction::getAllMetadata()
Change `Instruction::getAllMetadata()` to modify a vector of `Value` instead of `MDNode` and update call sites. This is part of PR21433. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -208,12 +208,11 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap,
|
||||
}
|
||||
|
||||
// Remap attached metadata.
|
||||
SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
|
||||
SmallVector<std::pair<unsigned, Value *>, 4> MDs;
|
||||
I->getAllMetadata(MDs);
|
||||
for (SmallVectorImpl<std::pair<unsigned, MDNode *> >::iterator
|
||||
MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) {
|
||||
MDNode *Old = MI->second;
|
||||
MDNode *New = MapValue(Old, VMap, Flags, TypeMapper, Materializer);
|
||||
for (auto MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) {
|
||||
Value *Old = MI->second;
|
||||
Value *New = MapValue(Old, VMap, Flags, TypeMapper, Materializer);
|
||||
if (New != Old)
|
||||
I->setMetadata(MI->first, New);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user