diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-12-28 08:14:54 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-12-28 08:14:54 +0000 |
| commit | 53bb5e4ae0b2b4d54f92a6f6a45dc19636bc2ff2 (patch) | |
| tree | de02a1613d6295fc1d1dd8e99df8cd0a08a5bcbd /llvm/lib/VMCore | |
| parent | 1bc810bb8973cc1f875d622cdb679f15963c30af (diff) | |
| download | bcm5719-llvm-53bb5e4ae0b2b4d54f92a6f6a45dc19636bc2ff2.tar.gz bcm5719-llvm-53bb5e4ae0b2b4d54f92a6f6a45dc19636bc2ff2.zip | |
change the strange MetadataContext::getMDs function to expose less
irrelevant internal implementation details to clients.
llvm-svn: 92210
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Metadata.cpp | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 13905ea1906..4ef57fed872 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -681,7 +681,7 @@ void SlotTracker::processFunction() { ST_DEBUG("Inserting Instructions:\n"); MetadataContext &TheMetadata = TheFunction->getContext().getMetadata(); - typedef SmallVector<std::pair<unsigned, TrackingVH<MDNode> >, 2> MDMapTy; + typedef SmallVector<std::pair<unsigned, MDNode*>, 2> MDMapTy; MDMapTy MDs; // Add all of the basic blocks and instructions with no names. @@ -2085,7 +2085,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { // Print Metadata info if (!MDNames.empty()) { MetadataContext &TheMetadata = I.getContext().getMetadata(); - typedef SmallVector<std::pair<unsigned, TrackingVH<MDNode> >, 2> MDMapTy; + typedef SmallVector<std::pair<unsigned, MDNode*>, 2> MDMapTy; MDMapTy MDs; TheMetadata.getMDs(&I, MDs); for (MDMapTy::const_iterator MI = MDs.begin(), ME = MDs.end(); MI != ME; diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 26b5294ac36..08433a17638 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/lib/VMCore/Metadata.cpp @@ -322,7 +322,8 @@ public: MDNode *getMD(unsigned Kind, const Instruction *Inst); /// getMDs - Get the metadata attached to an Instruction. - void getMDs(const Instruction *Inst, SmallVectorImpl<MDPairTy> &MDs) const; + void getMDs(const Instruction *Inst, + SmallVectorImpl<std::pair<unsigned, MDNode*> > &MDs) const; /// addMD - Attach the metadata of given kind to an Instruction. void addMD(unsigned Kind, MDNode *Node, Instruction *Inst); @@ -447,7 +448,8 @@ MDNode *MetadataContextImpl::getMD(unsigned MDKind, const Instruction *Inst) { /// getMDs - Get the metadata attached to an Instruction. void MetadataContextImpl:: -getMDs(const Instruction *Inst, SmallVectorImpl<MDPairTy> &MDs) const { +getMDs(const Instruction *Inst, + SmallVectorImpl<std::pair<unsigned, MDNode*> > &MDs) const { MDStoreTy::const_iterator I = MetadataStore.find(Inst); if (I == MetadataStore.end()) return; @@ -542,7 +544,7 @@ MDNode *MetadataContext::getMD(unsigned Kind, const Instruction *Inst) { /// getMDs - Get the metadata attached to an Instruction. void MetadataContext:: getMDs(const Instruction *Inst, - SmallVectorImpl<std::pair<unsigned, TrackingVH<MDNode> > > &MDs) const { + SmallVectorImpl<std::pair<unsigned, MDNode*> > &MDs) const { return pImpl->getMDs(Inst, MDs); } |

