aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-10 02:14:30 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-10 02:14:30 +0000
commitafba8fe662d65b25b4baf46bb26cc18e1f9cc0a5 (patch)
tree90d674eca01d05d52bdd394518dd2bc76db5c154 /lib/VMCore/Function.cpp
parent65b211807d524d50d8bb3429a4c5049fb2d3d3ac (diff)
downloadexternal_llvm-afba8fe662d65b25b4baf46bb26cc18e1f9cc0a5.zip
external_llvm-afba8fe662d65b25b4baf46bb26cc18e1f9cc0a5.tar.gz
external_llvm-afba8fe662d65b25b4baf46bb26cc18e1f9cc0a5.tar.bz2
Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed _sabre_: the vtable lives to fight another day git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index b1405e5..04db3aa 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -287,17 +287,16 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
ParentModule->getFunctionList().push_back(this);
}
-void Function::destroyThis(Function*v) {
- v->dropAllReferences(); // After this it is safe to delete instructions.
+Function::~Function() {
+ dropAllReferences(); // After this it is safe to delete instructions.
// Delete all of the method arguments and unlink from symbol table...
- v->ArgumentList.clear();
- delete v->SymTab;
+ ArgumentList.clear();
+ delete SymTab;
// Drop our reference to the parameter attributes, if any.
- if (v->ParamAttrs)
- v->ParamAttrs->dropRef();
- GlobalValue::destroyThis(v);
+ if (ParamAttrs)
+ ParamAttrs->dropRef();
}
void Function::BuildLazyArguments() const {