[llvm-commits] [llvm] r81141 - /llvm/trunk/lib/VMCore/Metadata.cpp
Daniel Dunbar
daniel at zuster.org
Sun Sep 6 21:05:50 PDT 2009
Author: ddunbar
Date: Sun Sep 6 23:05:49 2009
New Revision: 81141
URL: http://llvm.org/viewvc/llvm-project?rev=81141&view=rev
Log:
Disable MDNode uniquing.
- Hopefully this unbreaks some llvm-gcc bootstraps.
Modified:
llvm/trunk/lib/VMCore/Metadata.cpp
Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=81141&r1=81140&r2=81141&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Sun Sep 6 23:05:49 2009
@@ -90,11 +90,16 @@
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);
@@ -115,12 +120,27 @@
}
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();
More information about the llvm-commits
mailing list