summaryrefslogtreecommitdiff
path: root/include/llvm/Use.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Use.h')
-rw-r--r--include/llvm/Use.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/Use.h b/include/llvm/Use.h
index c5a3212ed8..c81a903e8b 100644
--- a/include/llvm/Use.h
+++ b/include/llvm/Use.h
@@ -37,7 +37,9 @@ public:
Use(Value *V, User *U) { init(V, U); }
Use(const Use &U) { init(U.Val, U.U); }
- inline ~Use();
+ inline ~Use() {
+ if (Val) removeFromList();
+ }
/// Default ctor - This leaves the Use completely unitialized. The only thing
/// that is valid to do with this use is to call the "init" method.