diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-01 00:26:42 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-01 00:26:42 +0000 |
commit | 4abd1a08080a950c0a03e65fd3f0116bb1371773 (patch) | |
tree | d59aa6ec289fea8450eee6c72244b5543d011259 /llvm/lib/IR | |
parent | e3da05ac323e0ac91a0cdd2d73d0908d0d17412d (diff) | |
download | bcm5719-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/IR')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/IR/Metadata.cpp | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 449225ae8c3..2dab6a44bc9 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -718,7 +718,7 @@ void SlotTracker::processFunction() { ST_DEBUG("Inserting Instructions:\n"); - SmallVector<std::pair<unsigned, MDNode*>, 4> MDForInst; + SmallVector<std::pair<unsigned, Value *>, 4> MDForInst; // Add all of the basic blocks and instructions with no names. for (Function::const_iterator BB = TheFunction->begin(), @@ -755,7 +755,7 @@ void SlotTracker::processFunction() { // Process metadata attached with this instruction. I->getAllMetadata(MDForInst); for (unsigned i = 0, e = MDForInst.size(); i != e; ++i) - CreateMetadataSlot(MDForInst[i].second); + CreateMetadataSlot(cast<MDNode>(MDForInst[i].second)); MDForInst.clear(); } } @@ -2315,7 +2315,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { } // Print Metadata info. - SmallVector<std::pair<unsigned, MDNode*>, 4> InstMD; + SmallVector<std::pair<unsigned, Value *>, 4> InstMD; I.getAllMetadata(InstMD); if (!InstMD.empty()) { SmallVector<StringRef, 8> MDNames; @@ -2328,8 +2328,8 @@ void AssemblyWriter::printInstruction(const Instruction &I) { Out << ", !<unknown kind #" << Kind << ">"; } Out << ' '; - WriteAsOperandInternal(Out, InstMD[i].second, &TypePrinter, &Machine, - TheModule); + WriteAsOperandInternal(Out, cast<MDNode>(InstMD[i].second), &TypePrinter, + &Machine, TheModule); } } printInfoComment(I); diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 6c335c78729..ba86e9e6085 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -745,8 +745,8 @@ Value *Instruction::getMetadataImpl(unsigned KindID) const { return nullptr; } -void Instruction::getAllMetadataImpl(SmallVectorImpl<std::pair<unsigned, - MDNode*> > &Result) const { +void Instruction::getAllMetadataImpl( + SmallVectorImpl<std::pair<unsigned, Value *>> &Result) const { Result.clear(); // Handle 'dbg' as a special case since it is not stored in the hash table. |