summaryrefslogtreecommitdiff
path: root/include/llvm/Constant.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/Constant.h
parent4d1c1efd800727165c12c2d186a5cb0b4f5834ab (diff)
downloadllvm-430444b10237abd37eb8157c3f84509a7d9636f8.tar.gz
llvm-430444b10237abd37eb8157c3f84509a7d9636f8.tar.bz2
llvm-430444b10237abd37eb8157c3f84509a7d9636f8.tar.xz
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/Constant.h')
-rw-r--r--include/llvm/Constant.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h
index d4949d1a0f..613e24ca15 100644
--- a/include/llvm/Constant.h
+++ b/include/llvm/Constant.h
@@ -61,7 +61,7 @@ protected:
public:
/// Static constructor to get a '0' constant of arbitrary type...
///
- static Constant *getNullValue(const Type *Ty);
+ static Constant *getNullValue(const Type *Ty, bool locked = true);
/// Static constructor to get a '-1' constant. This supports integers and
/// vectors.
@@ -107,7 +107,9 @@ public:
/// available cached constants. Implementations should call
/// destroyConstantImpl as the last thing they do, to destroy all users and
/// delete this.
- virtual void destroyConstant() { assert(0 && "Not reached!"); }
+ virtual void destroyConstant(bool locked = true) {
+ assert(0 && "Not reached!");
+ }
//// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Constant *) { return true; }