summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-09 22:46:10 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-09 22:46:10 +0000
commit3e5be66ccbaf4848ce8933d25fbe94b4f77aadb5 (patch)
tree67ac453213919d96c4b7bae5405ffa5a63b162ea /llvm/lib/VMCore/Function.cpp
parent4d62f42eba28e4a087420f8421baa6f43fb451ac (diff)
downloadbcm5719-llvm-3e5be66ccbaf4848ce8933d25fbe94b4f77aadb5.tar.gz
bcm5719-llvm-3e5be66ccbaf4848ce8933d25fbe94b4f77aadb5.zip
Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
llvm-svn: 44747
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r--llvm/lib/VMCore/Function.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 04db3aa06c3..b1405e59262 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud