[llvm-commits] [llvm] r92210 - in /llvm/trunk: include/llvm/Metadata.h lib/Bitcode/Writer/BitcodeWriter.cpp lib/Bitcode/Writer/ValueEnumerator.cpp lib/VMCore/AsmWriter.cpp lib/VMCore/Metadata.cpp
Chris Lattner
sabre at nondot.org
Mon Dec 28 00:14:55 PST 2009
Author: lattner
Date: Mon Dec 28 02:14:54 2009
New Revision: 92210
URL: http://llvm.org/viewvc/llvm-project?rev=92210&view=rev
Log:
change the strange MetadataContext::getMDs function to expose less
irrelevant internal implementation details to clients.
Modified:
llvm/trunk/include/llvm/Metadata.h
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/lib/VMCore/Metadata.cpp
Modified: llvm/trunk/include/llvm/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=92210&r1=92209&r2=92210&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Metadata.h (original)
+++ llvm/trunk/include/llvm/Metadata.h Mon Dec 28 02:14:54 2009
@@ -236,7 +236,7 @@
/// getMDs - Get the metadata attached to an Instruction.
void getMDs(const Instruction *Inst,
- SmallVectorImpl<std::pair<unsigned, TrackingVH<MDNode> > > &MDs) const;
+ 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);
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=92210&r1=92209&r2=92210&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Dec 28 02:14:54 2009
@@ -562,7 +562,7 @@
// Write metadata attachments
// METADATA_ATTACHMENT - [m x [value, [n x [id, mdnode]]]
MetadataContext &TheMetadata = F.getContext().getMetadata();
- typedef SmallVector<std::pair<unsigned, TrackingVH<MDNode> >, 2> MDMapTy;
+ typedef SmallVector<std::pair<unsigned, MDNode*>, 2> MDMapTy;
MDMapTy MDs;
for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end();
Modified: llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp?rev=92210&r1=92209&r2=92210&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp Mon Dec 28 02:14:54 2009
@@ -88,7 +88,7 @@
EnumerateType(I->getType());
MetadataContext &TheMetadata = F->getContext().getMetadata();
- typedef SmallVector<std::pair<unsigned, TrackingVH<MDNode> >, 2> MDMapTy;
+ typedef SmallVector<std::pair<unsigned, MDNode*>, 2> MDMapTy;
MDMapTy MDs;
for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;++I){
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=92210&r1=92209&r2=92210&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Dec 28 02:14:54 2009
@@ -681,7 +681,7 @@
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 @@
// 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;
Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=92210&r1=92209&r2=92210&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Mon Dec 28 02:14:54 2009
@@ -322,7 +322,8 @@
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 @@
/// 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 @@
/// 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);
}
More information about the llvm-commits
mailing list