aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MDNode.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-19 23:16:19 +0000
committerOwen Anderson <resistor@mac.com>2009-06-19 23:16:19 +0000
commit430444b10237abd37eb8157c3f84509a7d9636f8 (patch)
treebb95b125f17911c2cf3abaf7c98b0d1ccb1aa41f /include/llvm/MDNode.h
parent4d1c1efd800727165c12c2d186a5cb0b4f5834ab (diff)
downloadexternal_llvm-430444b10237abd37eb8157c3f84509a7d9636f8.zip
external_llvm-430444b10237abd37eb8157c3f84509a7d9636f8.tar.gz
external_llvm-430444b10237abd37eb8157c3f84509a7d9636f8.tar.bz2
Fix a serious bug that would cause deadlock during abstract type refinement. The constant creation
gets involved, and we end up trying to recursively acquire a writer lock. The fix for this is slightly horrible, and involves passing a boolean "locked" parameter around in Constants.cpp, but it's better than having locked and unlocked versions of most of the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73790 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MDNode.h')
-rw-r--r--include/llvm/MDNode.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/MDNode.h b/include/llvm/MDNode.h
index d632e4e..06b7177 100644
--- a/include/llvm/MDNode.h
+++ b/include/llvm/MDNode.h
@@ -78,7 +78,7 @@ public:
/// get() - Static factory methods - Return objects of the specified value.
///
- static MDNode *get(Value*const* Vals, unsigned NumVals);
+ static MDNode *get(Value*const* Vals, unsigned NumVals, bool locked = true);
Value *getElement(unsigned i) const {
return Node[i];
@@ -117,7 +117,7 @@ public:
/// duplicates
void Profile(FoldingSetNodeID &ID) const;
- virtual void destroyConstant();
+ virtual void destroyConstant(bool locked = true);
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) {
assert(0 && "This should never be called because MDNodes have no ops");
abort();