diff options
| author | Devang Patel <dpatel@apple.com> | 2009-09-09 17:30:04 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-09-09 17:30:04 +0000 |
| commit | 9a767cb5c0810bd451fa7434b7e73d5c65536459 (patch) | |
| tree | 46c0fbeb395d4c9e8767fa4a80fe92515882432f | |
| parent | c56af25c01c88b0584c6bd5e30b73c986d48d944 (diff) | |
| download | bcm5719-llvm-9a767cb5c0810bd451fa7434b7e73d5c65536459.tar.gz bcm5719-llvm-9a767cb5c0810bd451fa7434b7e73d5c65536459.zip | |
Enable MDNode uniquing.
llvm-svn: 81355
| -rw-r--r-- | llvm/lib/VMCore/Metadata.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 76f25285b80..8e025b6d7a2 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/lib/VMCore/Metadata.cpp @@ -90,16 +90,11 @@ MDNode *MDNode::get(LLVMContext &Context, Value*const* Vals, unsigned NumVals) { for (unsigned i = 0; i != NumVals; ++i) ID.AddPointer(Vals[i]); - // FIXME: MDNode uniquing disabled temporarily. -#ifndef ENABLE_MDNODE_UNIQUING - return new MDNode(Context, Vals, NumVals); -#endif - pImpl->ConstantsLock.reader_acquire(); void *InsertPoint; MDNode *N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint); pImpl->ConstantsLock.reader_release(); - + if (!N) { sys::SmartScopedWriter<true> Writer(pImpl->ConstantsLock); N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint); @@ -120,27 +115,12 @@ void MDNode::dropAllReferences() { } MDNode::~MDNode() { - // FIXME: MDNode uniquing disabled temporarily. -#ifdef ENABLE_MDNODE_UNIQUING getType()->getContext().pImpl->MDNodeSet.RemoveNode(this); -#endif dropAllReferences(); } // Replace value from this node's element list. void MDNode::replaceElement(Value *From, Value *To) { - // FIXME: MDNode uniquing disabled temporarily. -#ifndef ENABLE_MDNODE_UNIQUING - if (From == To || !getType()) - return; - - for (SmallVector<ElementVH, 4>::iterator I = Node.begin(), - E = Node.end(); I != E; ++I) - if (*I && *I == From) - *I = ElementVH(To, this); - return; -#endif - if (From == To || !getType()) return; LLVMContext &Context = getType()->getContext(); |

