diff options
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r-- | lib/VMCore/Constants.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index ff803dcf61..98df6ea4b7 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -441,6 +441,7 @@ void ConstantStruct::destroyConstant() { destroyConstantImpl(); } + //---- ConstantPointerNull::get() implementation... // static ValueMap<char, ConstantPointerNull> NullPtrConstants; @@ -452,6 +453,14 @@ ConstantPointerNull *ConstantPointerNull::get(const PointerType *Ty) { return Result; } +// destroyConstant - Remove the constant from the constant table... +// +void ConstantPointerNull::destroyConstant() { + NullPtrConstants.remove(this); + destroyConstantImpl(); +} + + //---- ConstantPointerRef::get() implementation... // ConstantPointerRef *ConstantPointerRef::get(GlobalValue *GV) { @@ -461,6 +470,14 @@ ConstantPointerRef *ConstantPointerRef::get(GlobalValue *GV) { return GV->getParent()->getConstantPointerRef(GV); } +// destroyConstant - Remove the constant from the constant table... +// +void ConstantPointerRef::destroyConstant() { + getValue()->getParent()->destroyConstantPointerRef(this); + destroyConstantImpl(); +} + + //---- ConstantExpr::get() implementations... // typedef pair<unsigned, vector<Constant*> > ExprMapKeyType; |