diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-09 22:46:10 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-09 22:46:10 +0000 |
commit | ed455c8fa25dd37a13b33f0afa66be03ac49b5bb (patch) | |
tree | 7bfa961474e22f830710a49d4ed015fe374967b7 /lib/VMCore/Function.cpp | |
parent | 46a6e79e602b23ea3478027d5bdd1f904aea7924 (diff) | |
download | external_llvm-ed455c8fa25dd37a13b33f0afa66be03ac49b5bb.zip external_llvm-ed455c8fa25dd37a13b33f0afa66be03ac49b5bb.tar.gz external_llvm-ed455c8fa25dd37a13b33f0afa66be03ac49b5bb.tar.bz2 |
Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r-- | lib/VMCore/Function.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 04db3aa..b1405e5 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -287,16 +287,17 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage, ParentModule->getFunctionList().push_back(this); } -Function::~Function() { - dropAllReferences(); // After this it is safe to delete instructions. +void Function::destroyThis(Function*v) { + v->dropAllReferences(); // After this it is safe to delete instructions. // Delete all of the method arguments and unlink from symbol table... - ArgumentList.clear(); - delete SymTab; + v->ArgumentList.clear(); + delete v->SymTab; // Drop our reference to the parameter attributes, if any. - if (ParamAttrs) - ParamAttrs->dropRef(); + if (v->ParamAttrs) + v->ParamAttrs->dropRef(); + GlobalValue::destroyThis(v); } void Function::BuildLazyArguments() const { |