summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-19 00:55:35 +0000
committerChris Lattner <sabre@nondot.org>2004-07-19 00:55:35 +0000
commit2730e6aef1a4d514d6e78c00a51e271f2dee1b71 (patch)
treeef37b7ef3343c5bc0d881702c2fad19d3ad764cb /llvm/lib/VMCore
parentd20f27064b4710bb4d345af200ce4c49a32bbf16 (diff)
downloadbcm5719-llvm-2730e6aef1a4d514d6e78c00a51e271f2dee1b71.tar.gz
bcm5719-llvm-2730e6aef1a4d514d6e78c00a51e271f2dee1b71.zip
Method now returns null, dtor is inlined
llvm-svn: 14983
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/Globals.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/VMCore/Globals.cpp b/llvm/lib/VMCore/Globals.cpp
index e35d801f8a5..ea877010114 100644
--- a/llvm/lib/VMCore/Globals.cpp
+++ b/llvm/lib/VMCore/Globals.cpp
@@ -50,25 +50,15 @@ static bool removeDeadConstantUsers(Constant* C) {
/// This function returns true if the global value is now dead. If all
/// users of this global are not dead, this method may return false and
/// leave some of them around.
-bool GlobalValue::removeDeadConstantUsers() {
+void GlobalValue::removeDeadConstantUsers() {
while(!use_empty()) {
if (Constant* User = dyn_cast<Constant>(use_back())) {
if (!::removeDeadConstantUsers(User))
- return false; // Constant wasn't dead
+ return; // Constant wasn't dead
} else {
- return false; // Non-constant usage;
+ return; // Non-constant usage;
}
}
- return true;
-}
-
-/// This virtual destructor is responsible for deleting any transitively dead
-/// Constants that are using the GlobalValue.
-GlobalValue::~GlobalValue() {
- // Its an error to attempt destruction with non-constant uses remaining.
- bool okay_to_destruct = removeDeadConstantUsers();
- assert(okay_to_destruct &&
- "Can't destroy GlobalValue with non-constant uses.");
}
/// Override destroyConstant to make sure it doesn't get called on
OpenPOWER on IntegriCloud