summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/ValueMapper.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-01 00:26:42 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-01 00:26:42 +0000
commit4abd1a08080a950c0a03e65fd3f0116bb1371773 (patch)
treed59aa6ec289fea8450eee6c72244b5543d011259 /llvm/lib/Transforms/Utils/ValueMapper.cpp
parente3da05ac323e0ac91a0cdd2d73d0908d0d17412d (diff)
downloadbcm5719-llvm-4abd1a08080a950c0a03e65fd3f0116bb1371773.tar.gz
bcm5719-llvm-4abd1a08080a950c0a03e65fd3f0116bb1371773.zip
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. llvm-svn: 221027
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index 0f20e6df6c9..31755427d77 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -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);
}
OpenPOWER on IntegriCloud